Create child record from Opportunity that requires a record type

  • 1
  • Question
  • Updated 4 years ago
I'm happy just having this be a button that triggers a redirect but can't figure out how to get the link.

I have Sales Order Forms (custom object) related to Opportunities.  Once a deal is closed, I want to give my reps the ability to go into the new SOF start.  This is the related list from the Opportunity:



That "new" button is what I'm trying to replicate on a Skuid page to take the rep here:


This brings them to the following page with some fields populated from the Opportunity including the link to the Oppy.


Thanks

This is the crazy link that I see when I click new:

https://na1.salesforce.com/setup/ui/recordtypeselect.jsp?ent=01I30000002LWp0&retURL=%2F0063000000wQFmr%3FsrPos%3D0%26srKp%3D006&save_new_url=%2Fa0j%2Fe%3FCF00N30000009rVy5%3DADP%2BWeinstein%2B2015%26CF00N30000009rVy5_lkid%3D0063000000wQFmr%26retURL%3D%252F0063000000wQFmr%253FsrPos%253D0%2526srKp%253D006
Photo of Joe Ort

Joe Ort

  • 2,256 Points 2k badge 2x thumb

Posted 4 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Out of curiosity, why use the standard sf page at all? Why not make a skuid page for this? Create the SOF model with URL parameter for the opp id.
Photo of Joe Ort

Joe Ort

  • 2,256 Points 2k badge 2x thumb
Over time I will convert everything but I'm approaching our roll-out in a phased approach.  If I can't get this done quickly, I guess I'll have to do that method...

I'm still not sure how to get the record type piece since the page layouts change based on RT.
(Edited)
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
That is a crazy url! Are you starting with a Skuid page that overrides the standard Opportunity detail page? I may be wrong, but I think you may be able to use the same url, replacing record Id values with merge syntax from your Skuid page. It looks like you have an opportunity Id in several places (with the 006 prefix in your url, in bold below). In the redirect url from your Skuid page, you can replace each of these with {{$Model.MyOpportunityModelName.data.0.Id}}. I'm not sure what the other Id's represent, but some of them just be object types (like, the Id for the Sales Order Form object type), so you may be able to leave them the same. Try that and see if it works. We may need to dig a little deeper.



https://na1.salesforce.com/setup/ui/recordtypeselect.jsp?ent=01I30000002LWp0&retURL=%2F0063000000wQFmr%3FsrPos%3D0%26srKp%3D006&save_new_url=%2Fa0j%2Fe%3FCF00N30000009rVy5%3DADP%2BWeinstein%2B2015%26CF00N30000009rVy5_lkid%3D0063000000wQFmr%26retURL%3D%252F0063000000wQFmr%253FsrPos%253D0%2526srKp%253D006
(Edited)