Custom actions
Actions are defined by a map object and are configured from the details page by clicking on the icon.
The administration page allows to choose the action name, type and other parameters depending of its type.
In this article
URL
If the type of action is a URL, only the internet address must be filled in.
Currently only two merge fields are dynamically taken into account in the different URLs:
- Salesforce ID :
{!id}
- Name of the object :
{!name}
For example, using the id, the URL to create a new task associated with an account is:
/00T/e?who_id={!id}&what_id={!id}
The account id is automatically inserted instead of {! Id} and the resulting URL is:
https://my.salesforce.com/00T/e?who_id=a0I61000000ZCf9EAG&what_id=a0I61000000ZCf9EAG
In the example of a Google search using the name of the object, the URL is:
https://www.google.fr/search?q={!name}
Salesforce actions on an account are:
Action | URL |
---|---|
New contact | /003/e?retURL=%2F{!id}&accid={!id} |
New opportunity | /006/e?retURL=%2F{!id}&accid={!id} |
New case | /500/e?def_account_id={!id} |
New task | /00T/e?who_id={!id}&what_id={!id} |
New event | /00U/e?who_id={!id}&what_id={!id} |
Log a call | /00T/e?title=Call&who_id={!id}&what_id={!Id}&followup=1&tsk5=Call |
Send an email | /_ui/core/email/author/EmailAuthor?p3_lkid={!id} |
New note | /002/e?parent_id={!id} |
Attach a file | /p/attach/NoteAttach?pid={!id}&parentname={!name} |
New partner | /opp/partneredit.jsp?id={!id} |
Add a campaign | /_ui/common/data/LookupPage?lkpr={!id}&lktp=701&enableScopes=1&addToCampaign=1 |
External links examples:
Action | URL |
---|---|
Google search from the name of the object | https://www.google.com/search?q={!name} |
Add a meeting in Google Calendar | http://www.google.com/calendar/event?ctext=+RDV+{!name}&action=TEMPLATE&pprop=HowCreated%3AQUICKADD |
LinkedIn search | https://www.linkedin.com/search/results/index/?keywords={!name}&page=1 |
Custom VisualForce page
In the case of a custom VisualForce page, it’s possible to choose how the action is opened when the link is clicked:
- In a new window
- In a modal window above the map: in this case, it’s possible to specify the size (width and height) either in pixels or in percentage
Example of an action that displays the Twitter feed from a custom Visualforce page: