6

I am trying to redirect the "New" case button to point to an intermediate page which will have 5 hyperlinks. These links will be pointing to the standard edit mode with some field values passed through the URL. Below is the image of the intermediate page.

Intermediate Page

User can click on any one of the option and they should be redirected to standard edit page for case.

Following is the URL is am using for redirect.

https://na15.salesforce.com/500/e?00Ni000000BGRVE=Communications&00Ni000000BGtUJ=Survey&00Ni000000BH0li=General%20Questions&cas8=Low&cas7=Closed&retURL=%2F500%2Fo

However on the page is not being redirected to the standard edit mode, the page refreshes itself and the user stays in the same page as the image above.

After override can we not access the standard pages? If so, is there any other way to access that page?

8

You can add the nooverride parameter to the page to get back to the normal page. Using your example URL:

https://na15.salesforce.com/500/e?nooverride=1&00Ni000000BGRVE=Communications&00Ni000000BGtUJ=Survey&00Ni000000BH0li=General%20Questions&cas8=Low&cas7=Closed&retURL=%2F500%2Fo

If you are using URLFOR, you can also specify TRUE as the fourth parameter to include the nooverride parameter. If you are using a PageReference, you can add it as a parameter:

ref.getParameters().put('nooverride','1');

The value doesn't matter, by the way-- it doesn't have to be 1. It's just a convention that most developers use from what I've observed (because salesforce.com themselves use that value, and people copy examples).

URLFOR has an optional fourth parameter that you can use. This forces the correct parameter for overriding any button override and showing the standard page. Here's an example that uses that (from the comments):

{!URLFOR($Action.Case.NewCase,null,['00Ni000000BGRVE'='Benefits','00Ni000000BGt‌​UJ'='401K','00Ni000000BH0li'='General Questions','cas8'='High','cas7'='Open'],true)}

You can use general formula functions inside the third parameter to include things like TODAY() or BR(). Text concatenation should use the salesforce.com formula syntax: 'Edit ' & Name might render as "Edit John Doe".

  • This is how u were envisioning <apex:outputLink value="{!URLFOR($Action.Case.NewCase),null,[00Ni000000BGRVE=Benefits,00Ni000000BGtUJ=401K,00Ni000000BH0li=General Questions,cas8=High,cas7=Open],true}">Link to 401K</apex:outputLink>. Is giving me an error saying too many ",". – Yash Mehta Oct 31 '13 at 20:21
  • 1
    You have an extra paren: {!URLFOR($Action.Case.NewCase,null,[00Ni000000BGRVE=Benefits,00Ni000000B‌​GtUJ=401K,00Ni000000BH0li=General Questions,cas8=High,cas7=Open],true} – sfdcfox Oct 31 '13 at 20:25
  • Sorry to keep bugging you.. I used the above code now it is giving me following error... Error: Syntax error. Found '['. I am new at this.. Thank you for your help and patience. – Yash Mehta Oct 31 '13 at 20:53
  • 1
    Sorry, I missed a paren of my own. Also, I believe quotes are in order. You also had some weird UTF-8 characters in the code. Here's my updated version: {!URLFOR($Action.Case.NewCase,null,['00Ni000000BGRVE'='Benefits','00Ni000000BGtUJ'='401K','00Ni000000BH0li'='General Questions','cas8'='High','cas7'='Open'],true)} -- I tested this in my developer org, so it should be good to go. – sfdcfox Oct 31 '13 at 21:16
  • 1
    +1 for using the standard URLFOR function to get back to the standard page with an override, always better then depending on undocumented parameters. Would be great to have that in your answer. – Ralph Callaway Oct 31 '13 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.