+ Start a Discussion
prasanth kumarprasanth kumar 

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.

User-added image
trigger accountApprovalSubmitAction on Account (after insert) {
for (Account a : trigger.new)
Approval.ProcessSubmitRequest appAction = new Approval.ProcessSubmitRequest();
Approval.ProcessResult resultAction = Approval.process(appAction);

Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you

Please mofidy your code according to above link sample