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
kenny ellekenny elle 

Automatic updating field when one record is submitted for approval

How to automatically update the status to review when one record is submitted for approval
I have type and request objects so when one record on type is submited for approval then request obj field status should update to reiew.how can i acheive this.can any one give me solution
Best Answer chosen by kenny elle
ShirishaShirisha (Salesforce Developers) 
Hi Kenny,

Greetings!

You can create the workflow rule or process builder based on the status.Once,you submit the record for approval then the Approval history status will be updated for Pending based on which you can update the status field on the record.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Kenny,

Greetings!

You can create the workflow rule or process builder based on the status.Once,you submit the record for approval then the Approval history status will be updated for Pending based on which you can update the status field on the record.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
This was selected as the best answer
Abhishek BansalAbhishek Bansal
Hi Kelly,

When you submit any record for approval, you have the options to add Initial Submission Actions where you can add Field Update as well. So if your requirment is to update any field on the same object than you can use this feature as shown in the screenshot as well:
User-added image

If you want to update any fields on the related object, than you can use triggers. Below steps can be used in this case:
  1. Create a new checkbox field like "Record Submitted for Approval". At the end when approval process is completed you can again set this field to false.
  2. Add a field update when record is submitted for approval and set this field as true.
  3. Write an apex trigger and check if this field value is changed to true. 
  4. If Yes, than query the related object and update the status as per your requirement.
Please let me know if you need any help with the trigger code.

Thanks,
Abhishek Bansal.