+ Start a Discussion
Sorcerer7Sorcerer7 

Auto Populate fields on a Task

I have created a custom button called "Log-A-Call" and placed it on the opt of the Contact Page...
User-added image
The code behind the button looks like this...
/00T/e?title=Call&what_id={!Contact.Id }&followup=1&tsk5=Call&retURL={!Contact.Id }
The only issue is when a User clicks the button, the fields for Contact and Account d not populate.
I'm still learning how to write APEX code, and I am not sure how to write this.
Thanks
Best Answer chosen by Sorcerer7
sumit singh 37sumit singh 37

for Contact use who_id and for Account use what_id

/00T/e?title=Call&who_id={!Contact.Id }&followup=1&tsk5=Call&retURL={!Contact.Id }-----> For Contact

/00T/e?title=Call&what_id={!Account.Id }&followup=1&tsk5=Call&retURL={!Account.Id }------>  for Account id

All Answers

sumit singh 37sumit singh 37

for Contact use who_id and for Account use what_id

/00T/e?title=Call&who_id={!Contact.Id }&followup=1&tsk5=Call&retURL={!Contact.Id }-----> For Contact

/00T/e?title=Call&what_id={!Account.Id }&followup=1&tsk5=Call&retURL={!Account.Id }------>  for Account id

This was selected as the best answer
Sorcerer7Sorcerer7
Thank you so much, it worked like a charm.
 
Sorcerer7Sorcerer7
With that being said, by using a URL, I am stuck with "A Window inside a Window".

User-added image

The red box is the smaller window that is created when you click the button. Then, once you fill in the data, you save, and then we have to have to go in an drefresh the main browser and close the smaller windoe inside.
Is this possible? Maybe making it Javascript or something??
THanks
sumit singh 37sumit singh 37
What is  Behavior picklist of  button ?
change the Behavior  to 'Display in new window' or other option as per the requirment
 
Sorcerer7Sorcerer7
Still have the same issue...

User-added image

The user would need to close the new window and then refresh the browser to make the logged call populate into the Activity History object.