1

I'm looking for a way to use URL hacking to create a child record from a parent object's record, without leaving the parent object record's page.

I have the following URL for my custom detail page button, which has been created on the parent object.

/a5H/e?CF00N70000003TE86={!MPM4_BASE__Milestone1_Task__c.Name}
&00N70000003TEAJ={!MPM4_BASE__Milestone1_Task__c.Time_To_Record__c}
&00N70000003TEAH={!TODAY()}
&retURL=/{!MPM4_BASE__Milestone1_Task__c.Id}

Which works fine but obviously when this is clicked, I am taken to the edit page for the new record.

I have seen this post which suggests that this functionality's not possible but I've also seen this answer which seems to suggest that it might be.

When I try to adapt the solution from the answer on post 2, using an encoded URL (adding &save=1 to the end of the above url)

/a5H/e?CF00N70000003TE86%3D%7B!MPM4_BASE__Milestone1_Task__c.Name%7D%0A%2600N70000003TEAJ%3D%7B!MPM4_BASE__Milestone1_Task__c.Time_To_Record__c%7D%0A%2600N70000003TEAH%3D%7B!TODAY()%7D%0A%26retURL%3D%7B!MPM4_BASE__Milestone1_Task__c.Id%7D%0A%26save%3D1

I'm just taken to the edit page of the child record and none of the fields are prepopulated.

1

Alex,

You can do this in a Flow pretty easily. I almost think the URL hack might be more confusing than a simple Flow triggered by the button.

Button Pressed --> Pass record ID into the Flow --> Create the child record with a Record Create --> Return to Parent Record w/ RetURL or VFP return on the Parent Record.

If you need to reference more fields, you can do some lookups or pass some in via the VFP or URL.

  • 1
    Thanks David, that's 'admin friendly' so it works for me. Your answer prompted me to consider the Process Builder & I realized that I could create the new record whenever the Time To Record field on the parent was populated / changed - but I was asking about a button in the question & that's what your solution would enable me to use. – Alex S Aug 16 '15 at 6:55
0

believe in option 1 you miss the / before the record id in returl param

/a5H/e?CF00N70000003TE86={!MPM4_BASE__Milestone1_Task__c.Name}&00N70000003TEAJ={!MPM4_BASE__Milestone1_Task__c.Time_To_Record__c}&00N70000003TEAH={!TODAY()}&retURL=/{!MPM4_BASE__Milestone1_Task__c.Id}

instead of url hack , I suggest you try to use publisher action or custom javascript button options ..

  • Thanks Vamsi, thought I'd ask the question to see whether this is possible with a URL hack, despite the other options - hacks are easier for an admin to adopt. I'll add the / to the return URL, to keep the Q&A focused on the main question. – Alex S Aug 15 '15 at 20:50

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.