I have created a custom button using URL (I am aware that it is not Lightning Ready). With the button, the user is taken to an edit page of a Child record of the Opportunity (Object X), then after saving that record the user is taken to Select Record Type of a Child of Object X (Object Y), then to the edit page of Object Y record;

Opportunity --> Edit page for Object X record --> Save --> Select Record Type for Object Y record --> Edit page for Object Y record --> Save

It all works fine, until I try to add retURL after saveURL and save_new_url. I would like to take the user back to the Opportunity record or even the Object X record if possible. Here is my working URL without any retURL after save;

/a00/e?retURL={!Opportunity.Id}&RecordType=012200000000Tpv&ObjectXfield={!Opportunity.Account&ObjectXfield _lkid={!Opportunity.AccountId}&ObjectXfield ={!Opportunity.Name}&ObjectXfield _lkid={!Opportunity.Id}&ObjectXfield ={!Opportunity.Account}&ObjectXfield={!Account.Booking_Office_Details__c}&ObjectXfield _lkid={!Account.Booking_Office_DetailsId__c}&saveURL=%2Fsetup%2Fui%2Frecordtypeselect.jsp%3Fent%3DObjectY%0A%26save_new_url%3D%2FObjectYprefix%2Fe%3F

Any assistance to add the retURl after my saves would be greatly appreciated!!

  • FYI URL buttons are lightning ready depending on what they are doing – Eric Aug 13 '17 at 6:17
  • Add the RetUrl param and value as part of the save_new_url making sure to urlEncode it – Eric Aug 13 '17 at 6:19
  • Hi Eric. Thanks for the feedback. I get the following error when i do that: <&saveURL=%2Fsetup%2Fui%2Frecordtypeselect.jsp%3Fent%3D01I0J000000SuCm%0A%26save_new_url%3D%2Fa6h%2Fe%3FretURL%3D%7B!Opportunity.Id%7D> "Invalid Page Redirection The page you attempted to access has been blocked due to a redirection to an outside website or an improperly coded link or button. Please contact your salesforce.com Administrator for assistance. For more information, see Insufficient Privileges Errors" – KarinG Aug 13 '17 at 14:11
  • looks like you encoded the {} as part of the URL – Eric Aug 13 '17 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.