Create Opportunity Button Redirect- Can I set field values in my URL?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
  • (Edited)
I have created a button that simply redirects the user to the standard salesforce create opportunity screen.  Is there a way to pre-populate opportunity field values in in my URL so that when the screen opens the values are already set?  For example, I would like the lead source field on the opportunity to pre-populate with "Prospecting".  
Photo of Stephen Chilcoat

Stephen Chilcoat

  • 732 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Stephen, I would suggest approaching this backwards, and start at the endpoint you're needing. In other words, if you head to the standard Salesforce account page and click "new opportunity," the URL you're sent to should illustrate for you how your Skuid page should build the URL. For me, it looks like this:

https://na35.salesforce.com/006/e?retURL=%2F0014100000HRU3y&accid=0014100000HRU3y

and I would then set up my Skuid button to head to a URL that looks something like

https://na35.salesforce.com/006/e?retURL=%2F0014100000HRU3y&accid={{{Id}}}

That should work for standard Salesforce objects and fields.  you'll need to make sure that your button's Model is pulling the id# field.
Photo of Stephen Chilcoat

Stephen Chilcoat

  • 732 Points 500 badge 2x thumb
I have already accomplished this piece Mark.  My redirect is working fine.  I am just wondering if there is a way to auto-populate some of the standard and custom fields (lead source, territory, etc.) on the page that my URL is pointing to.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
In that case, if you haven't already done so, it sounds like you may need to set up an override for this particular object. Here is documentation on overriding a detail page, and on our help page more override scenarios are covered as well if that doesn't fit your need. 
Photo of Stephen Chilcoat

Stephen Chilcoat

  • 732 Points 500 badge 2x thumb
I have my redirect pointing to the standard salesforce page.  I would like to keep it that way and just pass some values in the redirect URL itself.  Do you know if this is possible?