As you might use before trigger to update changed/old field value in running transaction. We have another way to achieve the same without coding. Any guess....... using process builder then you are wrong.
Flow is the right answer. Now let's see how can we do that. Here we go.
Step1- Create a custom field as oldName with text type in your object.
Step2- Search Flow in quick search.
Step3- Click on new button-->Select Record-Triggered Flow-->How do you want to start building?-->Select FreeformPlease select Trigger the flow when--A record is updated and Run the flow-- Before the record is saved.
Choose Object with conditions.
Step5- Add Update Records Element on white board. Provide the label name as Update Old Account Name.
Select newly created field to store old value. We have to use {!$Record__Prior.Name} in Value where Record__Prior will provide all old fields value.
Step6- Connect Start and update record and save. Once it is saved, activate the flow. Update one account record with account name change and see whether old name is captured or not.
Step6- Connect Start and update record and save. Once it is saved, activate the flow. Update one account record with account name change and see whether old name is captured or not.
This is an example for how to avoid writing trigger code and use flow to achieve the similar requirements.
Happy Learning!!
Comments
Post a Comment