You need to sign in to do that
Don't have an account?
youji37
invoke Approval in trigger problem
I use following code to invoke a approval process in trigger, the approval process will send an email to the owner's manager for approval, now the problem is when I update of insert the record, the approval will run twice, it will send two email to the owner's manager, but I only invoke it once as you can see in the trigger.
trigger autoApproveTrigger on Quote__c(after update,after insert) { for (Quote__c a : Trigger.new) { if(a.Quoted_Cost_Unit_Price__c < a.Field_Min1__c){ Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest(); req1.setComments('Submitting request for approval.'); req1.setObjectId(a.id); Approval.ProcessResult result1 = Approval.process(req1); }else{ //do nothing for other record type case. } } }
Is it possible that you have updated or inserted twice? or performed an insert then an update?
best regards,
Kerwin