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
brielea1984brielea1984 

Custom Button retURL

Hello, 

 

I have a custom button on an object called Service Plan, that allows the user to create a new record in the Assessment object. Through the custom button, fields are autopopulated. It seems that when I make these buttons for an object that has record types, the retURL doesn't pass through after a record type is selected. Thus, when the user clicks "Cancel" during data entry, they're kicked back to the home page rather than back to the Service Plan. 

 

Here is the code:

 

/setup/ui/recordtypeselect.jsp?ent={!$Setup.hhs__ButtonSettings__c.hhs__Assessment_Setup_Object_ID__c}&retURL=%2Fapex%2FServicePlan%3Fid%3D{!hhs__Service_Plan__c.Id}%26sfdc.override%3D1&save_new_url=%2F{!$ObjectType.hhs__Assessments__c}%2Fe%3F{!$Setup.hhs__ButtonSettings__c.hhs__Assessment_Service_Plan_ID__c}%3D{!hhs__Service_Plan__c.Name}%26{!$Setup.hhs__ButtonSettings__c.hhs__Assessment_Service_Plan_ID__c}_lkid%3D{!hhs__Service_Plan__c.Id}&{!$Setup.hhs__ButtonSettings__c.hhs__Assessment_Primary_Contact_ID__c}={!hhs__Service_Plan__c.hhs__Participant_Name__c}&{!$Setup.hhs__ButtonSettings__c.hhs__Assessment_Primary_Contact_ID__c}_lkid={!hhs__Service_Plan__c.hhs__Participant_NameId__c}&retURL={!hhs__Service_Plan__c.Id}}&Name="Assessment"

 

any ideas?

 

Thanks!