function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DkaniaDkania 

Save Asset and Redirect me back to a custom Object

Hi,

 

Let me first give you the setup so you know what is going on. We have a custom object called Facility Lease Agreement(FLA). There is a related list with all the Assets tied to this record. If you click 'New Asset' it will take you to the edit page of the Asset object where you can enter in the new Asset. After you hit save it will save the record and bring you to the detail page of that Asset.

 

So here is my question.

 

Is it possible to set it up to where if you hit save on that Asset it will save the record and then bring you back to the FLA instead of the Asset???

 

The reason we want to do this is because if you have to add multiple assets to one FLA you have to constantly navigate back to the FLA.

 

If anyone knows how I can do this with a custom button or a trigger that would be awesome!

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Alex_ConfigeroAlex_Configero

 

you will need a custom New button that has the saveURL parameter set to the FLA Id, something like this:

 

/02i/e?saveURL=%2F{FLAId}

All Answers

Alex_ConfigeroAlex_Configero

 

you will need a custom New button that has the saveURL parameter set to the FLA Id, something like this:

 

/02i/e?saveURL=%2F{FLAId}

This was selected as the best answer
DkaniaDkania

I was thinking a new save button would work but I don't know how to edit the pagelayout of the Asset Edit Page. Or just add a new button to the Asset Edit Page. Does anyone have any ideas about the button or maybe a trigger that would redirect them back to the FLA.

Alex_ConfigeroAlex_Configero

You can't edit the save button. You need a new "New" button, the saveURL parameter will carry over to when you hit save and take you to that url

DkaniaDkania

So I need to adjust the current New Asset button to have this SaveURL parameter in it?

 

Here is the current link that is in the button:

 

/02i/e?CF00N50000002MUK3={!Facility_Lease_Agreement__c.Name}&CF00N50000002MUK3_lkid={!Facility_Lease_Agreement__c.Id}&cntc_id={!Facility_Lease_Agreement__c.Contact_NameId__c}&acc_id={!Facility_Lease_Agreement__c.Account_NameId__c}&Name={!Facility_Lease_Agreement__c.Name} - &retURL=%2F{!Facility_Lease_Agreement__c.Id}

 

How would I add this parameter to it?

DkaniaDkania

So the saveURL Parameter did work Alex. Thanks for letting me know how you do this. I was looking for the wrong solution. I was thinking I had to create a new Save button when what really needs to be done is adjust the New button. Thanks Again. And if anyone is wondering here is how adjusted that link to include the parameter.

 

/02i/e?CF00N50000002MUK3={!Facility_Lease_Agreement__c.Name}&CF00N50000002MUK3_lkid={!Facility_Lease_Agreement__c.Id}&cntc_id={!Facility_Lease_Agreement__c.Contact_NameId__c}&acc_id={!Facility_Lease_Agreement__c.Account_NameId__c}&Name={!Facility_Lease_Agreement__c.Name} - &saveURL=%2F{!Facility_Lease_Agreement__c.Id}

Alex_ConfigeroAlex_Configero

I'm happy I could help :)