URL Redirection on edit of record

Have you ever wonder if we can redirect to another page once the record is created or updated? I have faced this requirement lot of times. So how I did that? Lets checkout!

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.

Technical Overview

  • 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.

Summary

Sharing the code through Git : https://github.com/SFDCDevs/AutoRedirect