You need to sign in to do that
Don't have an account?

Creating first Apex class
I have created a simply trigger that adds the values of two currency fields and renders the full amout into a total field.
I need assistance creating a class for this trigger so that I can deploy it
trigger Sum ON order__c(before insert, before update) {
for (order__c o: Trigger.new) {
if (Trigger.isUpdate && o.new_total_field__c != Trigger.oldMap.get(o.Id).new_total_field__c) {
continue;
}
o.new_total_field__c = o.hss_qty_price__c + o.sb_qty_price__c ;
}
}
Any feedback would be greatly appreciated
Thanks
D
I need assistance creating a class for this trigger so that I can deploy it
trigger Sum ON order__c(before insert, before update) {
for (order__c o: Trigger.new) {
if (Trigger.isUpdate && o.new_total_field__c != Trigger.oldMap.get(o.Id).new_total_field__c) {
continue;
}
o.new_total_field__c = o.hss_qty_price__c + o.sb_qty_price__c ;
}
}
Any feedback would be greatly appreciated
Thanks
D
My bad please use the updated code below.
All Answers
You can modify your existing code as follows.
thanks for this
it looks great
however I got
Error: Compile Error: Missing '<EOF>' at 'public' at line 18 column 1
what u think ?
My bad please use the updated code below.