Last Updated on November 12, 2017 by Rakesh Gupta
Business Use Case: – Sometimes we have the requirement to auto-populate account field while creating New Task from Contact.
Solution: – Simple solution is URL Hack.
Step1 :- Click On Name | Setup | App Setup | Customize | Activities | Task Buttons & Links then click on button New Button & Link
Step 2: Label this e.g. – New Task or as per your requirement. For Display type select List button, Behavior as per your choice. For Content Source make sure to select URL
/003/e :-“003” prefix signifying that we are looking at the Contact Object.“/e” means we are going to the edit page for a new instance of the object.
retURL:- This is the URL to return to if the “Cancel” or “Save” button is clicked on the new Task page.
Who_id for “Contact” & what_id for account
Step 3:- Create URL as mentioned snapshot.
Step 4:- Save it.
Step 5:- Edit “Contact Page Page layout and click on open activities related list, as shown in below screen shot.
Select Custom button “New Task ” to display on related list & Click on Ok button, Like below screenshot
Now Save contact Page Layout. Click on Custom “New Task” Button and see the magic
Please share your idea/Comment to improve the content
4 thoughts on “How to create a Task from a Contact and populate Account field using a Custom Link?”
Tom
Hello Rakesh. Thanks for the great tutorial. Have you been able to replicate this same approach in Lightning? Or is it not possible in Lightning? — Thanks
Rakesh Gupta
Thanks for your kind words, Tom!
I would suggest you – use “Quick Action” and if required use Process Builder behind the scene.
Allan
Isn’t it 00T instead of 003 for a new task?
Victor
Thanks…this blog solved my problem