function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
saisaisaisai 

Invalid parameter for function URLFOR Error


I have created 2 data objects for Master & Detail (named Person & Car) with ID & Name fields/columns in each of them. Then i have created a MasterDetail Relation for in Car for Person so a Person can have multiple cars.

 

Here is the error i get in Visual Force Page and i have been stuck on this for a while if anyone can help it will be appreciated:

 

Invalid parameter for function URLFOR
Error is in expression '{!URLFOR($Action.Car__c.View,PC.Name)}' in component <apex:outputLink> in page personcarmasterdetail

 

 

And here is my VF Page:

 

<apex:page standardController="Person__c" id="thePage">

<apex:form >
<apex:pageBlock >
<apex:pageBlockSection columns="1" >
<apex:inputField value="{!Person__c.ID__c}">
</apex:inputField>
<apex:inputField value="{!Person__c.Name__c}">
</apex:inputField>
</apex:pageBlockSection>
<apex:pageBlockTable value="{!Person__c.Cars__r}" var="PC" title="Cars" >
<apex:column headerValue="Car ID">
{!PC.ID}
</apex:column>
<apex:column headerValue="Car Name">
<apex:outputLink >
{!URLFOR($Action.Car__c.View,PC.Name)}"
</apex:outputLink>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
<!-- <apex:relatedList list="Cars__r"/> -->
</apex:page>

 

Please help.
Thanks
Sai

Best Answer chosen by Admin (Salesforce Developers) 
Rise AnalyticsRise Analytics

Try this:

 

<apex:outputLink value="{!URLFOR($Action.Car__c.View,PC.Name)}">View
</apex:outputLink>