You need to sign in to do that
Don't have an account?
Insert task trigger
trigger assignTask on Opportunity (before insert, before update) { List<Task> task = new List<Task>(); List<Opportunity> newOpportunity = new List<Opportunity>(); for (Integer i = 0; i < Trigger.new.size(); i++) { if ((Trigger.new[i].Type == 'New Business')&&(Trigger.new[i].CC_Co_ordinator__c ==null)) { System.debug('triggerfire'); task.add(new Task( whatid=Trigger.new[i].Id, OwnerId=Trigger.new[i].CC_Co_ordinator__c, Subject='First Contact ' )); } } insert task; }
i found the problem it was due to field update done by workflow,
any way ignore this post
All Answers
its actually workign now
problem i'm having now its creates 2 tasks,
any ideas why?
i found the problem it was due to field update done by workflow,
any way ignore this post
Hey Maxa,
Can you extrapolate on the two task issue?
I am running this myself and everything works great, except it creates two tasks for me as well.
I don't see any live WF rules that would have anything to do with this, so I am at a loss as to what to do.
Please let me know what you did to fix it, or if anyone else can help it would be appreciated.
Thanks -
Alex
i have inserted tick box task created, and i update it when trigger runs, also put a condidtion if task created false then run trigger