0

I have the following URL on a VF page. I want the link to take you to the details entry point and not the record type picker screen which is currently happening. I can't find a good documentation point for what the input parameters are for URLFOR function. Can someone tell me what to tweak to make this work?

<apex:outputLink value="{!URLFOR($Action.Admin_Tracking__c.New, null, [p3='012230000004LDD', save=1])}" target="_blank">Advanced Entry</apex:outputLink>
4
  • If you have multiple record types configured, I would expect it to land on that selection page. How else would the system know which record type to assign to the new record?? Nov 16, 2016 at 23:04
  • Instead of using URLFOR can you try to use onclick = window.open('/006/e?RecordType=recordtype_id')
    – Rao
    Nov 17, 2016 at 0:08
  • The P3 value is the record type. I found this from a previous example of someone doing this.
    – Matt M
    Nov 17, 2016 at 14:23
  • @sfdcfox you have commented on this type of issue before. Can you see why mine won't work correctly?
    – Matt M
    Nov 17, 2016 at 14:35

1 Answer 1

3
+50

Your parameter is incorrect and to answer your question of URLFOR Explained:

<apex:outputLink value="{!URLFOR($Action.Admin_Tracking__c.New, null, [RecordType='012230000004LDD', save=1])}" target="_blank">Advanced Entry</apex:outputLink>

http://salesforcesource.blogspot.com/2008/12/urlfor-function-finally-explained.html

{!URLFOR(target, id, [inputs], [no override])}

Parameters shown in brackets ([]) are optional.

  • target: You can replace target with a URL or action, s-control or static resource.

  • id: This is id of the object or resource name (string type) in support of the provided target.

  • inputs: Any additional URL parameters you need to pass you can use this parameter. you will to put the URL parameters in brackets and separate them with commas ex: [param1="value1", param2="value2"]

  • no override: A Boolean value which defaults to false, it applies to targets for standard Salesforce pages. Replace "no override" with "true" when you want to display a standard Salesforce page regardless of whether you have defined an override for it elsewhere.

Although, this will not do what I suspect you actually want and bypass the record type selection page. Currently no way to do that using URLFOR

Alternate way of doing this: Build the url

http://blog.jeffdouglas.com/2010/03/30/short-cut-the-recordtype-selection-step/

/006/e?retURL=%2F{!Account.Id}&accid={!Account.Id}
&RecordType=YOUR-RECORDTYPE&cancelURL=%2F{!Account.Id}

Related Idea: https://success.salesforce.com/ideaView?id=08730000000BrRqAAK

Alternate solution: if you only have one record type assigned to each profile then the selection screen will not be presented

1
  • For anyone else who needs something like this, here is my final link. <apex:outputLink target="_top" style="color:white;" value="/a07/e?RecordType=012230000004LDD"> Advanced Entry </apex:outputLink>
    – Matt M
    Nov 28, 2016 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .