You need to sign in to do that
Don't have an account?
Functionality by apex code
General Development
I would like to accomplish with an Appex Code OR Visual Force button that when I go to any Contact to create an activity (task -event- log a call) this new Activity "WILL BE RELATED TO" the Account they are associated to.
Can you help me to accomplish this? Salesforce Basic Support guide me to Developers website
Thank you,
Golan Jason Lewkowicz
212-431-3476 x202
you can write triggers on event and task insert.
check if it is against contact. if yes retirve accountid of the contact by query and update in event or task.
Regards,
Pankaj Raijade
{
if(trigger.isinsert)
{
list<contact> ct=[select id,accountid,name from contact where id=:trigger.new[0].whoid];
if(ct[0].accountid !=null)
{
task temptask=[select id ,whoid,subject from task where id=:trigger.new[0].id ];
temptask.whatid=ct[0].accountid;
update temptask;
}
}
}