Button with a Redirect URL

  • 1
  • Question
  • Updated 8 months ago
  • Answered
I set up a button with redirect URL. The URL for particular account is:
https://c.cs65.visual.force.com/apex/ConvertOpportunityToLoanPage?id=001i000000zLAm1&productApiN...

We would like to create a URL would not redirect to particular account.

I used this inline code in the redirect url section:

/apex/ConvertOpportunityToLoanPage?id={{$Model.SelectedLoan.data.0.Id}}&productApiName=Product__c&productTypeApiName=Product_Type__c&productLineApiName=Product_Line__c&relationshipAPIName=id&convertedProductName={{$Model.SelectedLoan.data.0.Name}}&businessName={{$Model.SelectedLoan.data.0.Id15}}

We are getting an error message as "URL No Longer Exists". Any thoughts?
Thanks in advance.
Photo of Sume

Sume

  • 130 Points 100 badge 2x thumb

Posted 9 months ago

  • 1
Photo of Peter Hale

Peter Hale, Employee

  • 330 Points 250 badge 2x thumb
The url example you provided has more parameters than the inline code.  Parameters such as accountApiName, CF00Ni0000003frhF_lkid, etc.  Would those extra parameters cause the URL No Longer Exists issue?
Photo of Sume

Sume

  • 130 Points 100 badge 2x thumb
Those additional parameters are to derive user into the form, which we no longer need it, so i parsed them out. 
Even if I include all those additional parameters, still i am getting same error message. 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
One of the parameters you are passign is not what you expect.   Dig into your full URL studying all the parameters.  Especially look at the ID's to make sure they are the record you expect.  You will get this error if you do something like pass "AccountId" into a parameter that is expecting "ContactId". 

We do recommend not passing multiple "pre-population" parameters when you can pass the ID of the record you are using as basis.  Then in your destination page you query that record and use "field from another model" conditions to populate data on your new record.