Reference Custom Metadata Type Records in Default
Values
Default field values make your users more productive and decrease errors by reducing
the number of fields to fill in manually. Reference a custom metadata type record in a
default value. If a default field value changes, you can update it in the custom metadata
type instead of updating multiple field references.
Required Editions
Available in: Salesforce Classic and Lightning Experience
Available in: Enterprise, Performance,
Unlimited, and Developer Editions
You can create, edit,
and delete custom metadata type records from installed packages in:
Group and Professional Editions
Example Let’s say that your organization applies different discount rates to opportunities.
Here’s how you create the custom metadata field value.
Create a custom metadata type. In this example, we name it DiscountPercent.
Create a custom field for your type named discount.
Create a record, and name it IT.
Create a custom field on the Opportunities object, and name it Discount
Rate.
Note The formula editor doesn’t include custom metadata field types. Reference the
custom metadata field value manually. The TEXT() function for picklists isn’t supported.
When done, you
can reference the custom metadata field value as a default value to populate the
Discount Rate field. The syntax
is:
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.