I have a custom object - Object 1 and the Opportunity object. I've created a lookup field from the Opportunity to Object 1 and I am working on a trigger to populate the id of one related record into the lookup field, in order to reference some of the values, back on the Opportunity.
The related records on the Object 1 are being created first (as part of an integration) and one Opportunity, could have 1+ related records, but only one related record will be populated in the lookup field.
Once the lookup field is populated through the trigger, I want to be able to change the picklist value on the Opportunity based on a text field on Object 1.
I have tried to change the picklist value using PB or Workflow, but it didn't work.
The scenario is to change picklist value to:
- "A" - if the text field contains "a", but it might also contain "b", "c" or "d", but it should definitely contain "a".
For each picklist is a combination of the above.
For one picklist value though:
- "E" - if the text field contain 2 or more of the "a", "b", "c" "d" combination.
Considering the Opportunity can have more than one related record, I am not sure if it's possibe to do this through a formula - to check all the related records.
Workflow I have tried for one scenarion:
AND ( OR ( ISNEW(), ISCHANGED(Object_1__r.text_field__c) ), CONTAINS(Object_1__r.text_field__c, "a" && ("b" || "c" || "d")) )
and field update: picklist value = A
but the fuction ISCHANED cannot be refrenced for my field.
Any help or ideas will be much appreciated.
Thanks a lot.