I am new to Salesforce framework. Recently I am working on modifying an existing approval process which is as follows:


Here in the above criteria I would like to add one more OR condition:

 My_Object.Status__c == 'New'

So basically entry criteria will be:

  My_Object.Status__c == 'New' OR My_Object.Status__c == 'Pending'

Could anyone please give any pointer regarding this ?


It is relatively less common to modify Salesforce's declarative metadata, like Approval Processes, by editing their XML source. The Metadata API source representation isn't particularly ergonomic for humans, and it's easy to make mistakes that will result in it not deploying cleanly.

It's usually easier and safer to push the metadata into a Salesforce org, modify it there in the Salesforce UI, and then extract it back to source format.

However, if you prefer to work in the source here, you can do so. The Metadata API reference for the ApprovalProcess entity documents the XML tags you can use here. You'll need to add another <criteriaItems> tag, using the same pattern as the one you already have, but with the value to be compared changed to New. Then, you'll need to add a <booleanFilter> tag to store the filter logic, which looks like it should be 1 OR 2 here.

Finally, you'll need to test those modifications by pushing the source into an org and validating them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.