You need to sign in to do that
Don't have an account?
Scual
validationRule on CustomMetadataType
Hello all,
i need to create a validationRule on a Custom Metadata Type
Custom Metadata Type : ConfigMatchingPhone__mdt,
Field : ObjetType__c (EntityDefinition)
Field :LookupField__c(FieldDefinition).
Value on my Record are :
ObjetType__c : Contact
LookupField__c : Account
SOQL query: select ObjetType__r.QualifiedAPIName,LookupField__r.DataType from ConfigMatchingPhone__mdt
Result :
ObjetType__r.QualifiedAPIName: Contact
LookupField__r.DataType : Lookup(Account)
i want to check data LookupField__c is a lookup of Account.
ValidationRule :
NOT(CONTAINS(LookupField__r.DataType,"Lookup(Account)"))
this is not work!
How i can do that?
Please help
i need to create a validationRule on a Custom Metadata Type
Custom Metadata Type : ConfigMatchingPhone__mdt,
Field : ObjetType__c (EntityDefinition)
Field :LookupField__c(FieldDefinition).
Value on my Record are :
ObjetType__c : Contact
LookupField__c : Account
SOQL query: select ObjetType__r.QualifiedAPIName,LookupField__r.DataType from ConfigMatchingPhone__mdt
Result :
ObjetType__r.QualifiedAPIName: Contact
LookupField__r.DataType : Lookup(Account)
i want to check data LookupField__c is a lookup of Account.
ValidationRule :
NOT(CONTAINS(LookupField__r.DataType,"Lookup(Account)"))
this is not work!
How i can do that?
Please help
ValidationRule :
LookupField__r.DataType !="Lookup" /* on all user language */
this is work!
i can't check if the data LookupField__c is a lookup on Account SOBject.
how work DataType FieldDefinition?
DataType return the label of the type.
ex:
phone type : "Phone" (English), "Téléphone"(French) /*use $label for the condition*/
Lookup Type :"Lookup"(English), "Lookup"(French)
All Answers
https://help.salesforce.com/articleView?id=custommetadatatypes_field_validation.htm&type=5
ValidationRule :
LookupField__r.DataType !="Lookup" /* on all user language */
this is work!
i can't check if the data LookupField__c is a lookup on Account SOBject.
how work DataType FieldDefinition?
DataType return the label of the type.
ex:
phone type : "Phone" (English), "Téléphone"(French) /*use $label for the condition*/
Lookup Type :"Lookup"(English), "Lookup"(French)