We currently do not have any Approval Processes in our Opportunity object. But we have just come up with a new Record Type which would require an Approval Process. All of the rest of the Opportunity Record Types will still not need an App Process. I am trying to account for all of the potential problems this could cause.

The first thing that comes to mind is a potential error for all of the other Record Types because they won't meet any approval process criteria. Do I need to write an Approval Process which would account for all of the other Record Types and would just automatically "approve" those in order to take the whole approval function out of the equation for them in order to avoid an error ?

Is there anything else I need to account for in this ?

  • check my answer just in case it gives other thoughts – Santanu Boral Apr 18 '17 at 18:28

All you need is just a validation in the approval entry for the right record type, then you just add 'Submit for Approval' button only to the page layout for that record type, so user won't get confused whether they have to send to approval or not.

  • Thank you for the input @Oleksiy. So, I guess as long as I don't include the Submit button on the other page layouts they'll never be submitted - and therefore I'll never have a "doesn't fit an approval process criteria" error. Is that correct ? – Zoom_v Apr 18 '17 at 17:13
  • Exactly, otherwise users (from my experience) get confused why there is an error when they blindly click on the button. Idea @avijit-das mentioned to have Approval status field is commonly used (usually Boolean type - e.g. InApproval) and can be used in some validations as usually record get locked (optional) and users complain - you have to educate them to use 'Recall from Approval' if you decide to use locking. – o-lexi Apr 18 '17 at 17:19

You can add record type criteria in your approval process. Create one field for Approval status and make this field updated after the record has been approved. For other record types this field should be blank or some other values. By doing this you can use this field for future reference.

  • Thank you for the input @Avijit. Yes, I intended to put record type into the criteria. But since that would be the only record type which would need an app process it would also be the only to fit a criteria. I didn't know if the other record types might experience an error somewhere since they never fit a criteria. I guess that wouldn't be a problem...? – Zoom_v Apr 18 '17 at 17:11
  • @zoom_v, like standard Salesforce behavior after click on submit for approval button if the approval process criteria does'nt match then it will show that no approval process was defined.otherwise you need to have custom coding by creating custom button. – Avijit Das Apr 18 '17 at 17:43

There are 2 ways you can do that:

  1. Create approval process and include the desired recordtype in the criteria for approval. Create separate page layouts for recordtypes and place 'Submit for Approval' button in that page layout where approval is eligible.

  2. You can create a custom button and write the following code and place any page layout.

Here based on recordtype, you should submit for approval, otherwise throw the error there.

var rdType = "{! Opportunity.RecordType}"; 

if(rdType = 'your recordtype name')
  window.open('{!URLFOR($Action.Opportunity.Submit, Opportunity.Id, null, true)}','_self');

   alert("You cannot submit for approval for this recordtype");


I have given an example considering Opportunity record to be submitted for approval.

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.