Sunday 5 May 2019

Configure Default Field Values with Custom Metadata Types

Hi ,

Now with Spring 19 we can configure default field values with custom metadata types.
While creating fields you can defined the default value using formula expression. In formula expression you may not able to see the  record name with field from meta data type.

But you can following syntax to include one metadata record field value. 

$CustomMetadata.CustomMetadataTypeAPIName.RecordAPIName.FieldAPIName

Eg:

$CustomMetadata.DiscountPercent__mdt.IT.discount__c

Here
DiscountPercent__mdt - API name of the metadata type

IT - is API Name of the record in the metadata type

Discount__C- is  Field API Name of the metadata type where we configure discount value.


By using this you can avoid updating the data references when there is any default value change in future instead you just need to change in one location which reflects all references.


3 comments:

  1. Want to update bulk metadata in Salesforce in few clicks,Bulk Object Field Creator Most recommended and appreciable app by Salesforce MVP

    ReplyDelete
  2. You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers.
    qq online

    ReplyDelete
  3. Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene.
    link judi online

    ReplyDelete

How to include a screen flow in a Lightning Web Component

 Hi, Assume  you have a flow called "Quick Contact Creation" and API Name for the same is "Quick_Contact_Creation". To i...