2

I'm trying to create a New Quote Option button that pre-populates certain fields. The Quote Option object is a custom child of the Standard Quote object. I've managed to pre-populate the fields I need just fine, but cannot get my retURL to populate correctly in the case where a user needs to hit the cancel button.

I've looked at the URL for the standard New Quote Option:

enter image description here

And I've tried to replicate it in my button:

enter image description here enter image description here

What I'm confused about it that I'm using Quote.Id in the URL code, and it doesn't give me the correct Id. When I check Quote.Id and Quote_Option__c.Quote__c in the SF IDE, I get the correct Id, but when I use Quote.Id in my URL code, I get an Id that doesn't make sense.

Can someone help me select the correct field so that I can pull the Id I need? The lkid id is the same one I believe I need for the retURL.

UPDATE:

Custom URL code when clicking button:

https://cs41.salesforce.com/a0N/e?CF00Nd0000005Jsti=Quote+1+-+Hall+Spa+%26+Resort+-+HPL+-+2014&CF00Nd0000005Jsti_lkid=515&CF00N55000000TNhu=Hall+Spa+%26+Resort&CF00N55000000TNhu_lkid=00155000003Aua4&saveURL=%2F515&retURL=%2F515

Code in button:

/a0N/e?CF00Nd0000005Jsti={!Quote.Name}&CF00Nd0000005Jsti_lkid={!Quote.Id}

&CF00N55000000TNhu={!Quote.Organization__c}&CF00N55000000TNhu_lkid={!Quote.OrganizationId__c}

&saveURL=%2F{!Quote.Id}&retURL=%2F{!Quote.Id}

CF00Nd0000005Jsti is Quote Name field. CF00N55000000TNhu is Account Name field.

4
  • Thanks for updating. So now I see that the problem is that the {!Quote.Id} mergefields are somehow producing 515 instead of the proper Quote Id... Does that happen to be the 3-digit prefix for Quotes in your org? I'm guessing that gets subbed in because there isn't a proper Quote reference in context when you click the button. Where does this button live, inside a related list on Quote layout? Commented Jun 16, 2015 at 16:08
  • No, the 3 digit prefix for Quote in our Org is 0Q0. Yes, the button lives inside related list on the Quote layout. Quote Option is a junction object. There are two Master-Detail relationships, one to Quote and one to a custom object called Pricing Option. There are also two lookup relationships, one to Opportunity and one to Account.
    – italiahall
    Commented Jun 16, 2015 at 17:38
  • 2
    Okay, so I really dug into this and it happens that a field that was created back when we first deployed our Org was the culprit. Someone created a custom Id field on Quote, labeled Id__c. Somehow, even when I used Quote.Id, the code was still trying to reference the Id__c field. When I removed that field from our custom fields list, and clicked my custom button, suddenly the system recognized the REAL id field, and not the fake one, and when I hit cancel the page returned to the Quote page. Thank you for working with me on this one! It helped me dive down into the root of the issue.
    – italiahall
    Commented Jun 16, 2015 at 18:20
  • Glad you figured that out! Still very strange though because {!Quote.Id} shouldn't even be able to resolve to {!Quote.Id__c} Commented Jun 16, 2015 at 18:30

1 Answer 1

1

I'm wondering why your button code includes raw Ids instead of field names... Have you tried simply including a &retURL={!Quote.Id} at the end of your button code? That should do what you want.

3
  • Thank you for your answer. I have the raw ids in order to pull data into the fields. My retURL code is: &retURL=%2F{!Quote.ID}
    – italiahall
    Commented Jun 16, 2015 at 15:14
  • Oh, so those are the Ids corresponding to your custom fields, makes sense. That retURL expression should work fine though... Would you please update your post with clearer screenshots of the resulting URLs and full button code? Commented Jun 16, 2015 at 15:25
  • I've updated with the resulting URL and full button code.
    – italiahall
    Commented Jun 16, 2015 at 15:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .