An Approval Process is an automated process an organization can use to approve records in Salesforce. It specifies the steps which are necessary for a record to be approved and the users who will approve it at each step. The Approval process can be set up on most of the Salesforce Objects. However, Salesforce currently does not provide the leverage to set up an Approval Process on Opportunity Product object. It would be beneficial to set up an Approval Processes on Opportunity Products as the users will be able to submit pricing, terms, discount, etc changes for submission on the fly.
One solution for this scenario is to submit the Opportunity for Approval based on any custom field populated from their related Opportunity Product records and get it approved. There are several workarounds available for this like set up a roll-up field on Opportunity Object and set entry criteria of Approval Process based on that rollup field, etc. One shortcoming of this approach is that it doesn’t provide any information about the Opportunity Product which actively contributed to the submission, i.e. the Opportunity Product which was to be submitted for approval. So if we are willing to perform an action on Opportunity Product based on approval of its corresponding Opportunity then this solution will not be fruitful for us.
So, here we propose a solution for this scenario. In this solution, the users will be able to perform desired actions on Opportunity Product item on approval of Opportunity for that particular Opportunity Product record. There will be a custom button on the Opportunity Product related list of an Opportunity record. On clicking this button the users will be directed to a visualforce page that will list all the Opportunity Products related to that Opportunity. The user will then have to choose the Opportunity Product for which they are willing to submit the Opportunity for approval. Once an Opportunity is submitted for approval, it can not be submitted again until any action is taken on the previous request. While submitting the Opportunity for approval we store the Id of Opportunity Product record in a custom field on Opportunity object. After the approval action on that Opportunity, we will perform the operation that we need to perform on Opportunity Product via an Apex Trigger. In such way, it will give an impression that the Opportunity Product itself was submitted for approval.