You need to sign in to do that
Don't have an account?
I need help with APEX Trigger for Approval process
I am trying to get an opportunity to auto submit for an approval process called Incentive offer when the field Incentive offer in the oppportunity is Yes.
I build the following but keep getting an error message error: expecting a right parentheses, found 'Offer' at line 5 column 30
trigger OpportunitySubmitForApproval on Opportunity (after update) {
for (Integer i = 0; i < Trigger.new.size(); i++) {
if (Trigger.Incentive Offer Yes) {
// create the new approval request to submit
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setComments('Submitted for approval. Please approve.');
req.setObjectId(Trigger.new[i].Id);
// submit the approval request for processing
Approval.ProcessResult result = Approval.process(req);
// display if the reqeust was successful
System.debug('Submitted for approval successfully: '+result.isSuccess());
}
}
}
You should probably post this on the Apex Board, this one is geared mostly towards basic Formula Code
Will do thank you