Issue with Redirect URL coding

  • 1
  • Question
  • Updated 1 year ago
  • Answered
I am trying to set up a button with a redirect url code. The code we need to use for the button is (without directing to this particular account): https://procoretechnologies--zqu.na29.visual.force.com/apex/CreateQuote?crmAccountId=0013400001JkD3tAAF&oppId=00634000019hw9hAAA&quoteType=Subscription&stepNumber=2

We used this inline code in the redirect url section: 
https://procoretechnologies--zqu.na29.visual.force.com/apex/CreateQuote?crmAccountId={{#urlEncode}}{{AccountId}}{{/urlEncode}}&oppId{{#urlEncode}}{{Id}}{{/urlEncode}}&quoteType=Subscription&stepNumber=2

However we are getting an error message and it doesn't direct us to the correct page. Any thoughts?

Thanks so much!
Photo of Kristyn Melanson

Kristyn Melanson

  • 172 Points 100 badge 2x thumb
  • aggravated

Posted 1 year ago

  • 1
Photo of Michael Schniepp

Michael Schniepp

  • 1,808 Points 1k badge 2x thumb
Great question!
Photo of John Dahlberg

John Dahlberg, Champion

  • 2,442 Points 2k badge 2x thumb
Try a triple mustache on the Id fields.  The double mustache usually has SKUID render the field as a URL with the name field displaying.  The extra mustache merges the raw value of the reference field.  

Also, you shouldn't need to wrap with the urlEncode for the Id fields as they are always alphanumeric with no special characters.  Here's the adjustment:

https://procoretechnologies--zqu.na29.visual.force.com/apex/CreateQuote?crmAccountId={{{AccountId}}}&oppId{{{Id}}}&quoteType=Subscription&stepNumber=2
Photo of Kristyn Melanson

Kristyn Melanson

  • 172 Points 100 badge 2x thumb
quoteType must be set as a URL parameter 

An unexpected error has occurred. Your solution provider has been notified. (zqu)
Photo of John Dahlberg

John Dahlberg, Champion

  • 2,442 Points 2k badge 2x thumb
You have a special string in the url that is being converted to the actual character when it is being rendered.  &quot is used for a quotation mark (usually used as ").  The result is that: 

&quoteType=Subscription&stepNumber=2 

is converted to:

"eType=Subscription&stepNumber=2

in other words '&quot' is converted to '='

This is a really stupid parameter convention on the part of the service provider (I would consider this a bug), but you can probably get around it by moving that parameter first.  Outside of this you can try escaping the string, but I can't give you a specific tip on that without some fiddling.  Try this to build the url in the sequence referenced above:

https://procoretechnologies--zqu.na29.visual.force.com/apex/CreateQuote?quoteType=Subscription&stepNumber=2&crmAccountId={{{AccountId}}}&oppId{{{Id}}}
(Edited)
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Kristyn,

I think you need to append the namespace for Zuora in front of your apex page reference.  Please try this URL:

/apex/zqu__CreateQuote?quoteType=Subscription&stepNumber=2&crmAccountId={{{AccountId}}}&oppId{{{Id}}}

Note that you should not add the 'site' to your URL.  The 'site' is the "https://procoretechnologies--zqu.na29.visual.force.com" preceding the part you need.  This will cause the URL to fail in a sandbox.

Thanks,

Bill
Photo of Kristyn Melanson

Kristyn Melanson

  • 172 Points 100 badge 2x thumb
IT WORKED! Thank you so much! :)