Questions tagged [custom-metadata-types]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
51 views

Custom Metadata types not supported in Apex Classes?

I'm using a Custom Metadata type to hold the counter for a round robin. The following code provokes an error: Account_Managers_List__mdt AMList = Account_Managers_List__mdt.getInstance('...
0
votes
0answers
30 views

Apex to return custom metadata and dynamic object data

I am looking to have a lightning web component that returns data from an object based on the record I am on that i can display on a lightning record page . I am exploring programmatically pulling a ...
1
vote
0answers
21 views

Converting custom metadata type to custom object [closed]

There is a requirement to convert custom metadata type to custom object because of size constraints of metadata. There are certain records already in custom metadata type. Need to migrate the entire ...
0
votes
1answer
31 views

Dynamic Questionnaire in SFDC

I am looking for a solution to dynamic questionnaire solution where the next question depends on the response of the previous and i need to store the response as well for each question and based on ...
0
votes
1answer
29 views

Need help with using Apex to determine thresholds for a field

We have a field on the account, Market_Segment__c, that is controlled by the following piece of code: public static string getMarketSegment(integer employeeCount){ if(employeeCount < 201) ...
2
votes
1answer
25 views

Custom metadata with Entity Definition field in Scratch Org fails to display custom object name

we have that Custom Metadata which contains a "Entity Definition" field, which is basically a lookup to an object (either standard or custom). We pulled our source from a sandbox to a Github ...
0
votes
0answers
22 views

Dynamically reference MetaData Type field in Apex

I'm attempting to create re-usable code passing in the API name of a field. I want to reference that field Dynamically in code, but I'm unsure how to. Additional Context: This Code will be used to ...
0
votes
1answer
118 views

Custom Metadata Error: Developer name already exists for given entity or has been previously used. Please choose a different name

We are trying to update custom metadata records via deployment from source org (Dev Sandbox) to target (i.e. Packaging environment - Dev Edition), these records were packaged into a managed release in ...
0
votes
2answers
441 views

How to get Custom Metadata Type PickList field values using LWC getPicklistValues and getObjectInfo

I'd like to access the picklist values of a field on a Custom Metadata Type from an LWC: import { getPicklistValues } from "lightning/uiObjectInfoApi"; import { getObjectInfo } from "...
1
vote
0answers
29 views

Can we programmatically determine Custom Metadata Type picklist values?

I would like to create a Custom Metadata Type picklist, and I want the values of the picklist to programmatically display the names of user Roles in the org. So if someone adds a new user Role, the ...
0
votes
0answers
21 views

Metadata migration

I migrated the custom metadata type from lower to higher environment but I am unable to view any records. Is it anywhere related to profile access issue.
1
vote
0answers
46 views

Case Validation rule - using custom metadata type

I need to block certain email domains in order to create Email2Case. To meet this requirement, I have created A custom metadata type (Case_Block_Email__mdt) and a text field called Email_Domains__c ...
2
votes
2answers
138 views

ERROR: The same comparison operation (LIKE or =) must be specified for all OR conditions

I'm getting a malformed query exception: "The same comparison operation (LIKE or =) must be specified for all OR conditions". The select statement contains something like this: SELECT Id ...
1
vote
1answer
71 views

Custom metadata type Field Definition Data Type evaluating incorrectly in validation rule

A custom metadata type has a Field Definition related to an Entity. The following validation rule ensures the value of this field can only be a User lookup: AND( FieldDefinition__c != NULL, ...
1
vote
1answer
101 views

Retrieving audit fields of a custom metadata type object

Problem: need to know who and when created and/or last modified the custom metadata type object. This information is captured in various system fields on the object. The screenshot shows two such ...
4
votes
1answer
71 views

Retrieving CreatedById of a custom metadata type

Is it possible to query fields like CreatedById on a custom metadata type record? Evidently not, but apparently I should be able to?! SELECT CreatedById from MyObject__mdt No such column '...
1
vote
2answers
153 views

Custom Metadata Type: Metadata field type linking to a Salesforce User

I have a custom metadata type that stores configuration information related to my Salesforce package. One piece of information I'd like to store is a link to a Salesforce user. The field controls ...
2
votes
0answers
92 views

How to delete custom metadata type record using apex

By using CustomMetadata class we can update or create custom metadata type records as below, Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata(); customMetadata.fullName = '...
0
votes
2answers
205 views

How to create a flow that updates region (picklist) based on inputted shipping states?

I am trying to figure out a way to dynamically update a custom picklist field called Account.[Region] based on an inputted shipping state (text field). The reason we're not considering a formula field ...
1
vote
1answer
43 views

Using Custom metadatype to compare which fields are modified

I'm trying to do some actions like calling a class when an only separate set of fields are modified on an object. What I did I'm using trigger.old and trigger.new to compare values of old and new for ...
1
vote
0answers
22 views

Is there a way to hide Custom Settings and Metadata Types to Profiles? [duplicate]

Is there a way to hide Custom Settings and Metadata Types to Profiles? Thank you in advance! :)
17
votes
7answers
2k views

Custom Metadata vs. Custom Objects in Managed Package

I worked on Managed packages for nearly 10 years now and never missed Custom Metadata Types. Not before they came and not after they were announced. I didn't come across a single great and technical ...
1
vote
1answer
32 views

How quickly are updates to Custom Metadata Types committed?

In continuing to evaluate the best approach to storing security credentials, I have found the following Trailhead module for Secure Secret Storage: https://trailhead.salesforce.com/content/learn/...
0
votes
1answer
78 views

Add custom metadata records to unlocked package [closed]

Like the question says. I'm trying to find a way to add custom metadata records to an unlocked package.
0
votes
1answer
7k views

How to fetch Custom Metadata Type record in apex and compare it with a string

I have a string which is holding email ids of users from my org. Now I have few custom metadata type records which are holding email IDs of users who are inactive. Now I need to compare the string ...
1
vote
1answer
314 views

No create/update access for object when importing records from CSV via Salesforce CLI

I've been testing to insert a custom metadata type record from a CSV file via Salesforce CLI. I've used below command but I've been getting the following error: Command sfdx force:data:bulk:upsert ...
1
vote
1answer
189 views

Packaged Custom Metadata Type Records Not Editable Once Deployed Even Though They Are Public

I have a managed package which has a custom metadata type. My package has default records in that custom metadata type. The custom metadata has been set to have a visibility of Public. Also, those ...
1
vote
1answer
201 views

Comparing Checkbox Field Values of Two Unrelated Objects Using Map in Salesforce Apex Trigger

I am trying to get field values of a Custom Metadata Type and compare to same field values in another custom object. If combination of checkbox values in custom object matches one of the combinations ...
1
vote
1answer
105 views

Is it advisable to store file id in Salesforce Custom Metadata Type?

I have been trying to understand custom metadata types in Salesforce, but there's still a lot of confusion on my end. I understand that hardcoding record ids is not a best practice, and I would like ...
0
votes
0answers
34 views

Can you create/delete custom mdt records from a Flow?

I'm creating a flow to help users administer Custom Metadatatype records. No problem reading in the mdt records into a collection variable, and displaying them in a multi-select picklist. However, i'...
0
votes
1answer
810 views

getting an error System.DmlException: Update failed. First exception on row 0 with id 00N000000FqP2cIAF; first error:

I am getting in MyTestClass System.DmlException: Update failed. First exception on row 0 with id 00N000000FqP2cIAF; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access ...
2
votes
0answers
195 views

Unlocked Package - Modify Custom Metadata Type in Subscriber Org

I created an Unlocked Package that contains a Custom Metadata Type (CMT). When I install this package inside an org, I would like to give access to admins to edit this deployed CMT (e.g. - create a ...
0
votes
1answer
125 views

salesforce app cannot create custom metadata types on after installing on Environment Hub Orgs

I have a salesforce app and push the code on scratch orgs. Its working fine and Custom Metadata Types are created successfully. I packaged and promoted the app successfully using ISV account. then I ...
-2
votes
1answer
66 views

getting an error Comparison arguments must be compatible types: List<User>, List<Case__mdt>

private static void whoCanClosetheCase() { List <Case__mdt> FederationIdinCustomMetaDataType = [SELECT DeveloperName, Federation_ID__c FROM Case__mdt]; List <User> ...
0
votes
0answers
23 views

Make users in custom metadata type to change case status to 1) proceed and 2) decision in apex trigger [duplicate]

I have created Custom metadata that will store the federation Id of the Users who can close cases. I will need to write a trigger to allow these users to change the status of the case 1) proceed and 2)...
1
vote
1answer
36 views

Is Metadata.CustomMetadata and Metadata.Operations available in Essentials and/or Professional edition?

I can't really find much on the subject - is Metadata.Operations and Metadata.CustomMetadata available in Salesforce Professional and/or Essentials? I know that simply selecting metadata like so [...
1
vote
0answers
458 views

Get Multi select picklist and update corresponding category using custom metadata type

We have a Custom Metadata Type which shows the relation between a product of interest and categories. When a product of interest is selected we would like the corresponding categories to be selected. ...
2
votes
3answers
225 views

Disjunctions not supported on a flow (Bulk?)

Has anyone encountered a "Disjunctions not supported" while automating with a flow getting values from a custom metadata? Do you have any recommendations? From the reading that I did, "Disjunctions ...
1
vote
0answers
96 views

How To Optimize Looping?

I've written a utility class that enables a Custom Metadata Type mapping for Object to Object data cloning. I'd like our Admin team to be able to add/create/adjust the Fields on either object without ...
2
votes
1answer
274 views

Can DeveloperName Be Updated via Apex Metadata API in a Custom Metadata Type?

I want to update the DeveloperName field via Apex in a Custom MetadataType. I would like to replace "VALUE1" with "VALUE2". Instead, however, it just inserts another line. Is it possible to update ...
3
votes
2answers
58 views

Writing tests that require multiple versions of custom data

OK here is a real fun one. I need to write tests that cover code that queries for custom metadata types. The code and test will be deployed to many different salesforce organizations which will ...
1
vote
2answers
1k views

Is it possible to query Custom Metadata type record labels?

I am looking for something like, API sObject name for the Custom metadata types, the way we have for ApexClass and ApexPage. I am trying to generate a list of Custom metadata type labels, CreatedBy, ...
7
votes
3answers
2k views

Do we need to check CRUD permissions on custom metadata type/custom setting to pass the AppExchange security review

I have an application that we need to upload on AppExchnage but we need to pass the security review so I have a query on the custom metadata type so do we need to check the isAccessible() permission ...
0
votes
2answers
33 views

Define CustomMetadata Type with API

I am trying to define a CustomMetadata type via an API. Any (Apex, REST etc) API is ok. So far I have only been able to create new instances of the type but I have not been able to define the type ...
1
vote
1answer
2k views

Updating Custom Metadata Type's Field value via Apex

I'm trying to update a Custom Metadata Type's Field value via Apex. I'm building an Account Assignment Round Robin tool, the Tool calls on the Custom Meta Data Type to get the Value of the position ...
0
votes
1answer
1k views

CREATE CUSTOM METADATA USING APEX

I wrote a little code that creates metadata custom type: public class CreateUpdateMetadataUtils implements Metadata.DeployCallback { public void handleResult(Metadata.DeployResult result, Metadata....
2
votes
0answers
29 views

Should I use List custom settings in my managed package app?

BACKGROUND I am working on a managed package application and I need to store some configuration data. This data is supposed to be edited by admins in the subscriber org. The setting simply stores ...
2
votes
0answers
64 views

Using Protected Component for “Secret Protection” with Unlocked Packages

How do "Protected Components" (Custom Settings or Custom Metadata) function when installed from an Unlocked Package. I was hoping that I would be able to use as "Protected (Managed)" to store "...
2
votes
2answers
3k views

Custom Label, Custom Setting or Custom Metadata Type for a simple URL

In one of my orgs, I have a simple Visualforce page with just an iframe inside. I don't want the URL to be hard-coded. I didn't develop anything else in this org. To store this simple URL, which one ...
2
votes
1answer
1k views

Custom Metadata Type - Page Layout - Can they be added to a managed package?

I have some Custom Metadata Types in a managed package. I just noticed that CMT's have page layouts. I can not see how I can add the CMT page layout or list view to my managed package. Is this ...