You need to sign in to do that
Don't have an account?
Shawn C King
Task Trigger
Does anyone know why an Activity is not showing up when I edit my BeazerLot__c object although I have made the following trigger code:
trigger CreateTaskonCloseofDateEscrow45DayCall on BeazerLot__c (after update) {
BeazerLot__c b = new BeazerLot__c ();
Task t = new Task();
t.OwnerID = trigger.new[0].Ownerid; //trigger.new[0].DefaultCaseOwner__c;
t.Subject = '45 Day Call';
insert t;
}
Yes, I will mark it as solution when I get it to show up on my BeazerLot screen. You have been an invaluable help! So if I understand correctly you are saying there is literally something called whatid? So would this code be adequate: (I've added the line before .add(t) statement)
All Answers
Try above code, should work.
Please mark as solution if this helped you.
Many Thanks,
Maf
Hello Maf, this also did not work. i am expecting the tasks.. so show up in Open Activities but see nothing. I ran a job from the database and under Beazer Lot History, it shows updates. I also tried to edit the address field to get the trigger to fire and nothing. Is there anything else you can think of
Hi,
Could you please check if your trigger is active for me. This trigger should create a task everytime you update your custom object.
Thanks,
Maf
Maf, thanks for your quick response, I am extremly new to SalesForce and have a tight deadline. Yes the Status is Active
Hi, I have checked the trigger just now and it has created a task for me. Go to home page and on calendar click activity list view you will see your task. Or enable related list on the object...
Oh, cool I see it on the Home Page. however I need it to show up in the Beazer Lot Page under open activities and it is not, any idea why?
Hello,
You need to give what id to the task.
like task.whatid = object.id;
Could you also mark as solution if that helped you??
Yes, I will mark it as solution when I get it to show up on my BeazerLot screen. You have been an invaluable help! So if I understand correctly you are saying there is literally something called whatid? So would this code be adequate: (I've added the line before .add(t) statement)
Yes that should show that in related list
it works, thanks for your help Maf
No Worries, Have a good day....:)