Salesforce Trigger to Unlock Quote Record locked by Approval Process
Budget: $30 – $250 USD
Overview: Create trigger code for Salesforce which unlocks a Quote record if a field has been edited to a specific value.
1. The customer is using Salesforce's CPQ addon which enhances Quotes with an object SBQQ__Quote__c
2. The customer is using Approval Processes for Quotes.
3. Normal SFDC behavior is for the Quote record to be locked during the Approval Process and automatically unlocked when the Approval Process completes.
4. This project is to create Trigger code which unlocks the record before the Approval Process completes if a particular field is updated to contain a specific value.
Quote_Stage__c is a picklist field.
The trigger will look at field Quote_Stage__c and if it is updated to have a value of “Finalize Quote” then the Quote record should be unlocked.
5. References:
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Approval_UnlockResult.htm
https://salesforce.stackexchange.com/questions/5377/are-triggers-able-to-modify-records-locked-by-an-approval-process
https://www.biswajeetsamal.com/blog/set-approval-process-lock-and-unlock-records-using-apex-code/
https://www.linkedin.com/pulse/apex-approach-manage-record-locks-salesforce-gaurav-gupta/
6. Note: I am aware that there are apps which provide flow components to unlock records, but found these to be inconsistent so that's why I'd like to go lower level and use the trigger.
Because of security for the customer, you will not have access to the customer Salesforce system. You will develop in your sandbox, provide me with the resources and I will retest in their sandbox. I realize that this is a hassle and will add some time. You may or may not need to setup Salesforce CPQ for this project. Given the simplicity of the changes, you may be able to mockup the object name and field names in a sandbox without doing that.
1. The customer is using Salesforce's CPQ addon which enhances Quotes with an object SBQQ__Quote__c
2. The customer is using Approval Processes for Quotes.
3. Normal SFDC behavior is for the Quote record to be locked during the Approval Process and automatically unlocked when the Approval Process completes.
4. This project is to create Trigger code which unlocks the record before the Approval Process completes if a particular field is updated to contain a specific value.
Quote_Stage__c is a picklist field.
The trigger will look at field Quote_Stage__c and if it is updated to have a value of “Finalize Quote” then the Quote record should be unlocked.
5. References:
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Approval_UnlockResult.htm
https://salesforce.stackexchange.com/questions/5377/are-triggers-able-to-modify-records-locked-by-an-approval-process
https://www.biswajeetsamal.com/blog/set-approval-process-lock-and-unlock-records-using-apex-code/
https://www.linkedin.com/pulse/apex-approach-manage-record-locks-salesforce-gaurav-gupta/
6. Note: I am aware that there are apps which provide flow components to unlock records, but found these to be inconsistent so that's why I'd like to go lower level and use the trigger.
Because of security for the customer, you will not have access to the customer Salesforce system. You will develop in your sandbox, provide me with the resources and I will retest in their sandbox. I realize that this is a hassle and will add some time. You may or may not need to setup Salesforce CPQ for this project. Given the simplicity of the changes, you may be able to mockup the object name and field names in a sandbox without doing that.