You need to sign in to do that
Don't have an account?
Vinicius Z
Trigger that create a task after insert in opportunity, compared by a multi-select picklist
I am new at force.com dev and I am working in a project that need to do one trigger after insert that works like this:
I will add an Opportunity, that have a field called "Contact by" (Multi-select picklist, values: email, phone), when value is email, The trigger will create a TASK and the field Subject of task get value of "Contact by" and ActivityDate get today + 5 days.
I know that work with workflows and its the best pratices, but I want to make this on a trigger, could you help me ?
I will add an Opportunity, that have a field called "Contact by" (Multi-select picklist, values: email, phone), when value is email, The trigger will create a TASK and the field Subject of task get value of "Contact by" and ActivityDate get today + 5 days.
I know that work with workflows and its the best pratices, but I want to make this on a trigger, could you help me ?
When you want to create Task only when Contact_by__c is Email
But the field contact_by__c has another value, how can I solve this ? Let think that we have 4 values, Email, Phone, Site, Facebook... Each one need to do this way, I dont know, but the multi-select picklist make me confused. I was reading about split method, but does not work..
Do you want to create a Task with the value present in it?
when the Multi-select picklist has Phone, Email, Site, Facebook
I am assuming that you would want to create all Tasks that you select in the Multi-Select
The last thing that I'm confused:
If I want to addDays to Email=5, Phone=8, Site=15 and Facebook = 4?
I've tried to create a primitive integer field to put in addDays(); but doesn't work.
How can I do this ?
Try this
I understand now. Chidambar really thank you.
When I get any questions again, I return to post.
See u