You can only use the following functions with Multi-Select Picklist fields:
- INCLUDES
- ISBLANK
- ISNULL
- ISCHANGED (Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited )
- PRIORVALUE (Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited )
None of these really work for substitution, unless you want to pursue a really ugly concatenation scheme using IF(INCLUDES(Multiselect__c), "a,", "") & IF(INCLUDES(...), "...", "")
. In addition to being ugly, this formula would likely exceed character limits, and you have to deal with the trailing comma somehow.
However, it would be fairly straightforward in a before
trigger.
for (MyObject__c record : trigger.new)
{
if (record.Multiselect__c != null)
{
record.SecondField__c = record.Multiselect__c.replace(';', ',');
}
}
You should question what you are really trying to achieve with this secondary field. There may be alternative, simpler means.
If you pursue an Apex Trigger
, you should read up carefully on Trigger Frameworks and Apex Trigger Best Practices.