Whenever there is the functionality to be implemented on record save, approach comes in our mind is by using Process Builder, Workflows, Triggers, Flows etc. But can we redirect to page using these available functionalities?
No right? That’s correct! But using Lightning Data Service its possible. Watch the video what I have implemented and how its working.
- A force:recordData component defines the parameters for accessing, modifying, or creating a record using Lightning Data Service. You have granular control on how you want to display or render the data in your custom component.
- Whenever the record is updated, using LDS, controller function can be called and process the functionality.
- With the help of this behavior and force:navigateToURL, on update of Type field, redirected to URL specified in Website field of Account record.
Sharing the code through Git : https://github.com/SFDCDevs/AutoRedirect