function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kunal Purohit 4Kunal Purohit 4 

How to Update the value of Field at time of insert/update operation.?

Hello All,
There is a custom metadata with four fields AreaCode,ZipCode,State and TimeZone. Whenever these field values are inserted/updated, TimeZone value need to be update. How to achieve this fucntionality through configuration or Lightning Flows?
Please suggest.
Best Answer chosen by Kunal Purohit 4
AnkaiahAnkaiah (Salesforce Developers) 
Hi Kunal,

It is not possible to create/update cmdt using triggers  and in the same way its not possible through flows also. Refer the below idea.
https://ideas.salesforce.com/s/idea/a0B8W00000Gdaj5UAB/apex-trigger-on-custom-meta-data-types

In your scenario, you need to use custom object instead of cmdt.

If this helps, Please mark it as best answer.

Thanks!!
 

All Answers

AnkaiahAnkaiah (Salesforce Developers) 
Hi Kunal,

It is not possible to create/update cmdt using triggers  and in the same way its not possible through flows also. Refer the below idea.
https://ideas.salesforce.com/s/idea/a0B8W00000Gdaj5UAB/apex-trigger-on-custom-meta-data-types

In your scenario, you need to use custom object instead of cmdt.

If this helps, Please mark it as best answer.

Thanks!!
 
This was selected as the best answer
Kunal Purohit 4Kunal Purohit 4
Thanks Ankaiah.
Kunal Purohit 4Kunal Purohit 4
What if want to update the timezone field based on AreaCode, StateCode and ZipCOde values at time of insert/update. But again the values of these three fields need to be get from custom metadata.? Please suggest.