You need to sign in to do that
Don't have an account?
HotCopper_Sales
Trigger on Task - Establish if task is related to Opportunity
I would to create a trigger. I am very new and am having trouble.
Could somebody please tell me if this is correct?
Could somebody please tell me if this is correct?
trigger TaskUpdateTrigger on Task (before insert) { For (Task t: Trigger.new){ if(t.what.type == 'Opportunity'){ System.debug(t.Subject+ 'is related to Opportunity'); } } }
Currently this has been posted in Idea and will soon be impletemented. Below is the workaround for now
t.whatId.substring(0,3) == '006' => for opportunity
t.whatId.substring(0,3) == '001' => for account
Mark it as answer if it solves the issue.
Thanks
Manoj S
All Answers
Currently this has been posted in Idea and will soon be impletemented. Below is the workaround for now
t.whatId.substring(0,3) == '006' => for opportunity
t.whatId.substring(0,3) == '001' => for account
Mark it as answer if it solves the issue.
Thanks
Manoj S
Only thing i would comment is that i need to type cast the Id to string first.