Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
I have built a component to override the new action on my Previous_address__c object which is a master detail relationship to the Account object.

When I hit save or cancel, the comonent stays open. I would like it to return to the account record I clicked 'new previous address' on.

Can anyone give me some pointers?

TIA
2 answers
  1. Aug 6, 2019, 10:58 AM
    Hi Baz,

    Greetings to you!

    You need to use force:navigateToSObject, this event enables you to navigate to an sObject record specified by recordId.

    Please refer to the below links which might help you further with the above requirement.

    https://andyinthecloud.com/2017/05/30/overriding-standard-actions-with-lightning-components/

    https://trailhead.salesforce.com/en/content/learn/projects/workshop-override-standard-action/override_4

    Please note, Salesforce recommends using lightning:navigation component with the standard__recordPage page type instead of force:navigateToSObject.

    I hope it helps you.

    Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

    Thanks and Regards,

    Khan Anas
Loading
0/9000