+ Start a Discussion
Brooks Kreutzer 10Brooks Kreutzer 10 

'Create a Record' Action Navigation

Scenario: I currently have an Action associated with the Account object that creates a new Opportunity, with fields mapped to that new Opportunity, from the Account where the user clicks the Action. I am attempting to replicate an existing business process that uses a URL hack embedded in a JavaScript button in classic. The action does everything that I need it too, except for navigating to the newly created Opportunity.

Question: Is there a method using Flows, Process Builder, or some other means, to make a 'Create a Record' Action automatically navigate to the newly created record, without the user needing to click a link in the related list, after the Action runs?

Note: I am trying to do this without writing any code, using only Administration.
Team NubesEliteTeam NubesElite
Hi Brooks,
Option 1:
Check what is being used in action. If you are using recordEditForm, then you can use onsuccess event to navigate to the record.
handleSuccess: function(cmp, event, helper) {
    var params = event.getParams();
    cmp.set('v.recordId', params.response.id);
    cmp.set('v.showSpinner', false);
    cmp.set('v.saved', true);
    // navService.navigate(pageReference);
Option 2:
You can use force:createRecord. Fire this event on the init of the custom component which is being used in action. After the record creation, it will automatically navigate to the created record.

Thank You
Development | Training | Consulting

Please mark this as solution if your problem resolved.