We have a requirement to updated the picklist values to new values. We are doing it via "Replace".

Whenever we do this, will the updated record fire Apex Triggers, Workflow Rules, etc.?


No, workflow rules, triggers, validation rules, flows, Process Builders, and any other logic that would run on a normal DML operation will not run as a result of using Replace.

  • Thnks for quick reply.,Is there any salesforce reference links related to this ? – SUresh Shettigar Nov 8 '16 at 14:01
  • 1
    @SUreshShettigar I don't remember where it's documented, but it's always been this way. Most "mass actions" you can do in setup won't activate any customizations or code. – sfdcfox Nov 8 '16 at 14:15
  • @SUreshShettigar There are a few special exceptions noted in the help document, such as updating StageName will also update Probability, Forecast Category, and Expected Revenue. Also mentioned is that Last Modified By fields will also be updated. However, no customization or code will run as a result of the replace feature. – sfdcfox Nov 8 '16 at 14:19

You can prove it yourself with a simple demo trigger:

trigger MyObject on MyObject__c (before update)
    for (MyObject__c record : trigger.new)
        if (trigger.oldMap.get(record.Id).Picklist__c != record.Picklist__c)
            record.addError('Cannot change picklist');

I ran a Replace on the MyObject__c.Picklist__c field with this trigger in place and the records successfully updated. Note that the LastModifiedDate value changes, as indicated in Difference between Renaming a Picklist and Replacing a Picklist Value:

Note: This is a global change and will replace the picklist value for all existing records, including records in the recycle bin. Also, this will update the Modified By date and time for all records where the value was replaced. Replacing / Renaming a pick list value will not update the record history related list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.