I've now read so many articles on Custom Metadata my head is spinning. Can someone give me a simple answer please as to how to use this instead of hardcoding a check for a value?
- I have a custom field on Account that holds an AccountGroup value
- I need to update a value on Accounts based on which AccountGroup it falls into
If account.accountgroup = 'ABC' then field = 'x' else if account.accountgroup = 'DEF' then field = 'y'
I would like to replace the hardcoded 'ABC' and 'DEF' with (what I believe is better) a metadata lookup.
I created a Custom Metadata Type with 2 fields, with example values in them:
GroupCode: 'ABC' GroupType: 'Primary'
Am I doing it correctly, and how will I go about using this Custom Metadata Type in my apex code trigger query above?