Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom button to Save and then navigate

KrantiRanginen1
Collaborator II

Hi,

 

I'm trying to create a custom button to Save the record first, and then navigate to a dashboard.

For another button, saving the record first and then add a new cross reference record.

 

But upon the Save, page reloads and the second action is not taking place if given along with Save. Individually it works fine. Is it possible to perform another action after Save / perform the save without reload of page?

 

This is the code I'm trying to use:

 

$('#SaveDraft').click(function(){
   $('#master_btnApply').click();
   $nf('../foundation/WorkspaceDashboard.aspx?workspaceId=112&dashboardId=292');
});

 

$('#SaveAdd').click(function(){
   $('#master_btnApply').click();
   $pb('#master_DefaultContent_rts_s5807_Add_New')[0].click(); 
});

2 REPLIES 2

DavidPetty
Archer Employee
Archer Employee

Kranti, the issue is that when a record is saved the page is refreshed and so is the custom object code.

 

You'd have to implement something that would set a session storage variable (Window sessionStorage Property) and upon the record "reloading" check for that variable, clear it and proceed with what you want to do next.

 Advisory Consultant

Thanks for the idea David! Will try and see if this works