function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Enara MarcosEnara Marcos 

Layout: Opportunity - Related list: Approval History - Button: Submit for approval - we can not hide it only in production

In Approval History related list in Opportunity page layout there are some buttons that apear which are not customized (submit for approval, recall,...)

We have a component in which we hide buttons with jquery. But it is impossible to hide the Submit for approval button in production (in Sandbox it is possible, and in production another button is possible).

We use some custom buttons in the opportunity that first validate it and then call the approval process. The buttons depends on the page layout. The Submit for approval button in the Approval History Related list, automatically call the approval process without the validations we need.
So, we need hide the Submit for approval button of the Approval History related list (because we are not allowed to customize the buttons in the related list to select the one that corresponds to the page layout). The Approval History related list must be showed in the page layouts.

The matter is that the code works properly in sandbox but not in production environment. This issue has nothing to do with our code, as it is the same in both environments. It has something to do with SFDC source code of approval history related list which is different in sandbox and production.