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
raj jordanraj jordan 

trigger to insert record on custom metadata type

hi all,
i want to create a trigger on custom metadata type to insert a record when all fields are entered if any of the field is null we should throw an error
can anyone help me through this

thanks in advance
 
Dmitry OfitserovDmitry Ofitserov
Hi raj,
I don't think it is possible to create a trigger on custom metadata, and you will have to create a custom object in order to use a trigger.
If you have to use custom metadata, maybe try creating some validation rules on it instead of a trigger.
https://help.salesforce.com/articleView?id=custommetadatatypes_field_validation.htm&type=5

Hope it helps.
mukesh guptamukesh gupta
Hi Raj,

CAn you please share your requirment, sothat i will try to resolve this.

Thanks 
Mukesh