Reply
Regular Contributor
mikeafter6
Posts: 22
0
Accepted Solution

URLFOR failing - trying to create a link to list-view (for a custom object)

[ Edited ]
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 '<' of each tag so that you can read the code:

_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
Trusted Contributor
Sam.arj
Posts: 203
0

Re: URLFOR failing - trying to create a link to list-view (for a custom object)

Check the following post. It may give you the answer:


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

http://salesforcesource.blogspot.com/2008/12/urlfor-function-finally-explained.html
Sam Arjmandi
Check my blog for tips and tricks:
http://salesforcesource.blogspot.com
Regular Contributor
mikeafter6
Posts: 22
0

Re: URLFOR failing - trying to create a link to list-view (for a custom object)

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.

 

Regular Contributor
mikeafter6
Posts: 22
0

Re: URLFOR failing - trying to create a link to list-view (for a custom object)

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>