0

I create one link named Submit Case to bring the user to the new Case.The requirement is user do not want to go through RecordType selection, they want the link bring them to the new Case page with prepopulated RecordType value.

I try to refer to this Avoid record type selection with URL button , but it still bring me to the Recordtype selection with prepopulated value, but still user needs to click 'Continue' to go to New Case page.Ya, I know sometimes user can be lazy =)

I put the link in custom visual force page like this

<apex:outputLink value="{!URLFOR($Action.Case.NewCase,null,[p3='01230000000xP1j',save=1],true)}">Submit Case</apex:outputLink>

It still display RecordType selection page.Now I wonder, is it doable to skip RecordType and directly go to new Case with prepopulated RecordType value?In case it is not doable, please provide me any documentation so I can inform the user.

Thanks a lot.

1

One way to do it is to manually walk through the selection of a recordType then grabbing the URL from the Case landing page and identifying the parameters used there:

https://instance.salesforce.com/500/e?retURL=%2F001i0000002MX2z&def_account_id=001i0000002MX2z&RecordType=012i0000001ELIz&ent=Case  

The example you have above is using p3 but I believe that is used for custom objects, you should be using RecordType instead.

Also, save=1 doesn't work without specifically asking SalesForce to disable a security feature, see docs here.

Here is a blog on another way of accomplishing this task using the url vs urlfor.

  • After the question mark in the URL you will see a parameter followed by an equal sign then a value, the word to the left is the parameter and the value on the right is what you want to populate it will. in the example above you see 3 one is RecordType which is the one you want to populate with your record type id. A good blog that helps explain how to use parameters in urlfor is salesforcesource.blogspot.com/2008/12/… – Jenny B Oct 31 '14 at 3:40
  • Yes, I read already but for my case the page Case url is like this my.salesforce.com/500/… . I know I can pass the RecordType parameter dynamically but what about this retURL=%2Fapex%2FHomePage%3Fsfdc.tabName%3D01r30000001AXqV , need to hardcode?Actually I m trying to find the documentation that explain what the meaning of this parameter. – unidha Oct 31 '14 at 3:45
  • I updated my answer with a blog post similar to what you are looking to do, the url in your comment, the rest of that url is saying what the return URL should be. – Jenny B Oct 31 '14 at 3:54
  • thanks, I figured it out with the answer provided for my case: /500/e?retURL={!URLENCODE($Page.MyHomepage)}&RecordType={!myrectype}&ent=Case . – unidha Oct 31 '14 at 10:10

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.