You need to sign in to do that
Don't have an account?
mikeafter6
URLFOR failing - trying to create a link to list-view (for a custom object)
I'm trying to create a link to the list-view for a custom object using URLFOR. I keep getting an 'Invalid paramater for function' error. (I've successfully been able to get this to work for .view & .edit.)
What am I doing wrong? Thanks!
ERROR: Invalid parameter for function URLFOR
VF CODE: Here is the failing code: I ommitted the beginning '
_apexpage>
_apexoutputLink value="{!URLFOR($Action.PersonTaskMessage__c.List,null,null,true)}">
click here.
_/apexoutputLink>
_/apexpage>
NOTE: '_' takes place of '
VARIATIONS ATTEMPTED:
1. value="{!URLFOR($Action.PersonTaskMessage__c.List,null)}
2. value="{!URLFOR($Action.PersonTaskMessage__c.List)}
3. attempted an apex:commandlink tag within an apex:form block, too.
Message Edited by mikeafter6 on 12-23-2008 08:20 AM
Message Edited by mikeafter6 on 12-23-2008 08:22 AM
What am I doing wrong? Thanks!
ERROR: Invalid parameter for function URLFOR
VF CODE: Here is the failing code: I ommitted the beginning '
_apexpage>
_apexoutputLink value="{!URLFOR($Action.PersonTaskMessage__c.List,null,null,true)}">
click here.
_/apexoutputLink>
_/apexpage>
NOTE: '_' takes place of '
VARIATIONS ATTEMPTED:
1. value="{!URLFOR($Action.PersonTaskMessage__c.List,null)}
2. value="{!URLFOR($Action.PersonTaskMessage__c.List)}
3. attempted an apex:commandlink tag within an apex:form block, too.
Message Edited by mikeafter6 on 12-23-2008 08:20 AM
Message Edited by mikeafter6 on 12-23-2008 08:22 AM
Solution: To use the 'List' action (via URLFOR), use 2 parameters:
First Param: name of action (e.g. $Action.Account.List)
Second Param: provide object type using the global variable $ObjectType (e.g. $ObjectType.Account)
<apex:outputLink value="{!URLFOR($Action.AnySObject__c.List,$ObjectType.AnySObject__c)}"> Click Here </apex:outputLink>
All Answers
http://salesforcesource.blogspot.com/2008/12/urlfor-function-finally-explained.html
http://salesforcesource.blogspot.com/2008/12/urlfor-function-finally-explained.html
Your post is helpful and addressesd many of my questions about URLFOR syntax. (It even helped with some of my custom actions).
Unless I'm missing something, the List action isn't described in your blog. For some reason, the 'List' action isn't working for me. I'm trying to create a command link to an objects list page. Also, it would be nice to specify a list-view to display.
Is URLFOR supposed to support the List action?
Thanks.
Solution: To use the 'List' action (via URLFOR), use 2 parameters:
First Param: name of action (e.g. $Action.Account.List)
Second Param: provide object type using the global variable $ObjectType (e.g. $ObjectType.Account)
<apex:outputLink value="{!URLFOR($Action.AnySObject__c.List,$ObjectType.AnySObject__c)}"> Click Here </apex:outputLink>