
Values API Name
Active 1
Inactive 2
Cancelled 3
I'm also told that it might be useful for integration with other systems. However, when API Names and Values differ this causes some inconveniences elsewhere (mass updates, certain reporting, etc.)
I've never seen a proper explanation of the best practice and when it's recommended to have API Names different from values in picklists. Does anybody have recommendations? Thanks.
4 respostas
If somebody had told me this, I would have found it very stupid because that seems very difficult to manage in my head at least.
I think you should have the person 'Why' when he/she suggested you this.
Anyways, what I have seen so far in my experience, a lot depends on the implementation structure. But I really cannot think where we would need this value to number mapping. But I can think of a use case when you would need a different API name then label.
Say you have a value 'A & B', then you have an external system using this value, and the character '&' is causing a problem(it mostly does), when the code is reading this picklist value. So in this case, you would keep the label as it is and use a different but similar value for the api name.
Makes sense?
Anyway, picklist API values are not be messed with. Becuase a lot of formula, automation rules, integrations etc are dependent on them.
Additional info:
https://developer.salesforce.com/blogs/developer-relations/2017/01/keeping-picklist-integrations-safe-using-api-names.html
https://help.salesforce.com/articleView?id=fields_picklist_protect.htm&type=5 (https://help.salesforce.com/articleView?id=fields_picklist_protect.htm&type=5)