+ Start a Discussion

urlfor to call "new contact" Page from visualforce page with Account standard controller


I want to use a custom button which takes the user to new contact page . My visualforce page is based on Account standard controller. I am trying to as below , but it give me and errror.
Error: Field $Action.Contact.New does not exist. Check spelling 
Error: Field $Action.Contact.New does not exist. Check spelling.

<apex:page standardController="account" extensions="AccountDetailController">
<apex:commandButton action="{!URLFOR($Action.Contact.New)}" value="New Contact">

How can i access the action method of contact from account standard controller visualforce page.??

MJ Kahn / OpFocusMJ Kahn / OpFocus
Change it to $Action.Contact.NewContact. If you look under Setup | Customize | Contacts | Buttons & Links, you'll see that the "new" action is actually named "NewContact," not just "New."
Ilya IvanovskiyIlya Ivanovskiy
<apex:outputLink value="{!URLFOR($Action.Contact.NewContact)}" target="_blank">
                Create New Contact
Create New Contact 
<apex:outputLink value="{!URLFOR($Action.Account.New)}" target="_blank">
    Create New Account
create a new account