0

Hey i am trying to redirect on a url on a click of custom button which will create a new quote in which name will be prepopulate as same as parent opportunity name but it is not redirecting on a page.I have tried this code. {!IF($User.UITheme = 'Theme3' , URLFOR("https://sam-khan-dev-ed.my.salesforce.com/0Q0/e?retURL=Opportunity.Id& oppid=Opportunity.Id&Name=Opportunity.Name") , 'Show error')}

It is showing this error.

Unable to Access Page
The value of the "oppid" parameter contains a character that is not allowed 
or the value exceeds the maximum allowed length. Remove the character from 
the parameter value or reduce the value length and resubmit. If the error 
still persists, report it to our Customer Support team. Provide the URL of 
the page you were requesting as well as any other related information.

1 Answer 1

1

You need to use the string concatenation syntax (&). Also be aware of spurious spaces.

{!IF($User.UITheme = 'Theme3',
  URLFOR("/0Q0/e?retURL=%2F" & Opportunity.Id & "&oppid=" 
         &Opportunity.Id&"&Name=" & Opportunity.Name"),
 'Show error')}

Or, even better, use the "params" function of URLFOR:

{!IF($User.UITheme='Theme3', 
  URLFOR('/0Q0/e', Opportunity.Id,
     [retURL='/'&Opportunity.Id, oppid=Opportunity.Id, Name=Opportunity.Name]),
  'Show Error')}
1
  • could you please help me with this {!IF($User.UITheme='Theme3', URLFOR('/0Q0/e', Opportunity.Id, [retURL='/'&Opportunity.Id, oppid=Opportunity.Id, Name=Opportunity.Name]), 'URLFOR('/'&apex&'/'&Create_New_Quote)'} Commented Sep 25, 2019 at 8:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.