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

trigger with auto approval process error
before this rigger i created an approval process in account object with condition "annual revenue <10000". If i am giving amount less than 10000 annual revenue in new account record the trigger is firing and sending auto approval process. but if i enter more than 10000 ... eg:- entering 12000 in annual revenue then clicking on the save button in account object then it is throwing error, Please help me.

trigger accountApprovalSubmitAction on Account (after insert) { for (Account a : trigger.new) { Approval.ProcessSubmitRequest appAction = new Approval.ProcessSubmitRequest(); appAction.setObjectId(a.id); Approval.ProcessResult resultAction = Approval.process(appAction); } }
http://www.jitendrazaa.com/blog/salesforce/dynamic-approval-process-based-on-the-apex-and-trigger/
Please mofidy your code according to above link sample