0

I want to build trigger when added/change values to a pick-list field in Case Object.

i tried a lot of examples (Apex-Trigger, MetaDataAPI) any of them not work for me, the trigger not raise. what I will do in the trigger it's doesn't matter, I need only to Activate the trigger.

can anyone know why the trigger not raise? to add new value to the picklist :

Object Manager --> Case Object --> Fields & ... --> *Select The relevant field (picklist type) --> press "new" --> add new value to the list --> press "Save" button --> the trigger not activate.

please HELP!

My Try:

trigger TestTrigger on Case (before insert,before update) {

    system.debug('Trigger is ON'); 

   // This line not show (other triggers works)

}

1 Answer 1

3

This is simply not possible. Case triggers, and all other triggers, fire on changes to Case records or other sObject changes.

You cannot write an Apex trigger that fires on changes to your application's metadata in Setup, such as picklist values. You'll need to approach your broader objective in some other way. For example, you can use the Describe API in a scheduled Apex class running every night to update data in response to picklist value changes.

1
  • Thank you very much!
    – Asaf Ben
    Commented Mar 29, 2020 at 13:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .