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
marie.tournemarie.tourne 

Error: Field $Action.Contact.New does not exist. Check spelling

Hello,

 

I have the error : Error: Field $Action.Contact.New does not exist. Check spelling

 

My code is as follows :

<apex:commandButton Value="New Contact" action="{!URLFOR($Action.Contact.New, id )}"

 

Whereas it says in the documentation the new action for contacts should normally be supported :

https://na12.salesforce.com/help/doc/user_ed.jsp?section=help&target=dev_action_values.htm&loc=help&hash=topic-title&instance=NA12&release=178.16.2

 

Any ideas ?

(I found a workaround by using the hard-coaded URL for creating a contact but I would prefer to use Action if possible)

Thanks by advance !

 

Gunners_23Gunners_23

I guess in the code snippet you don't need to pass the id as parameter and use the standardController attribute thats the reason its throwing error

 

<apex:page standardController="Contact" >

 

<apex:commandButton Value="New Contact" action="{!URLFOR($Action.Contact.New )}" />

Erik EriksonErik Erikson
Use $Action.Contact.NewContact
If you look at the Contact object, under buttons, links, and actions, that is the name listed.