You need to sign in to do that
Don't have an account?
Daniel Mason
Trigger which updates picklist value based on criteria
HI All
I need some help creating a trigger. This is my first time creating a trigger so my applogises if its incorrect.
Aim : Every time a task is created which meets criteria ( See below) then change the status (picklist) from “Not started” to “Completed”
The trigger should only fire if it meets the following criteria RecordTypeId = '0123000000007ZoAAI'
Type.contains 'meeting:'
Type.contains 'Call;'
Type = 'Other - see subject'
ownerid = 00E30000000gYL8
I have attempted to create the following trigger, but I am not sure if I am on the correct lines
Really looking forward to your help
I need some help creating a trigger. This is my first time creating a trigger so my applogises if its incorrect.
Aim : Every time a task is created which meets criteria ( See below) then change the status (picklist) from “Not started” to “Completed”
The trigger should only fire if it meets the following criteria RecordTypeId = '0123000000007ZoAAI'
Type.contains 'meeting:'
Type.contains 'Call;'
Type = 'Other - see subject'
ownerid = 00E30000000gYL8
I have attempted to create the following trigger, but I am not sure if I am on the correct lines
Really looking forward to your help
trigger UpdateStatus on Task (after insert) { for (Task t : trigger.new){ if (t.RecordTypeId == '0123000000007ZoAAI'){ if (t.Type.contains('meeting:')){ if (t.Type.contains ('Call;')) if (t.Type = 'Other - see subject'; } } } } } // Need to include assigned to owner/ if(t.OwnerId == '00E30000000gYL8'){ Status = 'Completed':
Good news - you dont need a trigger to do this. A workflow rule and field update should be used to do this instead. Let me know if you need any help confoguring the workflow rule.
Please remember to mark this thread as solved with the answer that best helps you.
Regards
Stephen
Dont worry, it can happen to the best of us :) Could you please remember to mark this thread as solved with the answer above so that others can find this thread more easily.
Thanks,
Stephen