You need to sign in to do that
Don't have an account?
Daniel Roberts 23
Global action for creating contacts
I'm doing some trailheads on visual force pages, and in this particular module, you learn that you can use the following code snippet to create accounts.
However, I can't get it to do the same thing for contacts when I replace Account with contact. And I get an error that says "Field$Action.Contact.New does not exist. Check Spelling"
The code that I have is this:
The documentation says that the "new method" is compatible with Contacts, I just don't know how to get it to work.
Thanks,
<apex:outputLink value="{!URLFOR($Action.Account.New)}"> Create New Account </apex:outputLink>
However, I can't get it to do the same thing for contacts when I replace Account with contact. And I get an error that says "Field$Action.Contact.New does not exist. Check Spelling"
The code that I have is this:
<apex:pageBlock> <apex:pageBlockSection> <apex:outputLink value="{!URLFOR($Action.Contact.New)}"> Create New Contact </apex:outputLink> </apex:pageBlockSection> </apex:pageBlock>
The documentation says that the "new method" is compatible with Contacts, I just don't know how to get it to work.
Thanks,
try below snippet
<apex:page >
<apex:outputLink value="{!URLFOR($Action.Contact.NewContact)}">
Create New contact
</apex:outputLink>
</apex:page>
All Answers
try below snippet
<apex:page >
<apex:outputLink value="{!URLFOR($Action.Contact.NewContact)}">
Create New contact
</apex:outputLink>
</apex:page>