Questions tagged [custom-metadata]

Custom metadata types are like list custom settings, but the records are deployable and packageable metadata.

Filter by
Sorted by
Tagged with
1
vote
0answers
83 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. ...
-1
votes
2answers
40 views

Metadata and apex triggers [closed]

I have a requirement as follows: Create metadata and fields in this metadata the fields should be equal to the Number of apex triggers present. The fields created in metadata should be of type ...
2
votes
1answer
48 views

What is the performance difference between custom metadata types and record based configuration?

It is my understanding that custom metadata types are more efficient than record based configuration because you do not have to hit the database to retrieve their information. Is this correct? Are ...
1
vote
0answers
17 views

Unlocked Package Custom Metadata SubscriberControlled not working

I have an unlocked package that uses custom metadata to store settings (Shipment_Setting__mdt). XML of the Shipment_Setting__mdt <?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="...
1
vote
1answer
39 views

Is there a simple way to get the values of a list in a comma separated string all in once

I have a custom metadata type in which I want to add the API names of some custom fields to use the values in a Dynamic Soql. I used a list to get the values of the custom metadata fields. Is there a ...
0
votes
1answer
43 views

Trying to see if a Custom Field Value starts with any names from a Custom Metadata Type

I'm extremely new to APEX, but it seemed like this was a simple enough requirement. I have a custom field on the Account Record, and a list of 'bad codes' as a custom metadata setting. I need the ...
1
vote
2answers
89 views

Custom Metadata type records within Process Builder?

I am trying to refactor our existing Trigger code to more of a Process builder's process. In one of the trigger methods, we are using a List of Custom metadata type records to see if Contact.Name is ...
1
vote
1answer
47 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 ...
0
votes
1answer
65 views

Custom Metadata/Settings/Labels for Configuring a Visualforce page?

Goal I'm looking to build a mechanism to allow system administrators to easily configure various components of a Visualforce page that is used in a site (without having to modify code). I would like ...
0
votes
0answers
35 views

First item in Map returning null when getting key value while iterating through List

I'm building a List<String> with the column header row from a CSV file to iterate through and get the API value from a Map<String,String> that is built from custom metadata. The issue I'm ...
2
votes
2answers
42 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
1answer
39 views

How to test a static void @HTTP method that creates custom metadata

Here's a fun one...I have a static @HTTP method creating metadata as a webservice. You can test metadata deployment containers, though not the actual deployment, as shown here, but apparently only if ...
1
vote
3answers
76 views

Control access exclusively to custom metadata screen

I am wondering what is the way to get edit access to a specific custom metadata using PermissionSet in UI. Here is what i have done: Setup -> PermissionSet-> MyPSName system permission -> checked ...
0
votes
1answer
52 views

Editing protected Custom Metadata Type in subscriber org through LMA org

I do have verified that the Protected custom settings are editable when logged in through LMA org. However, I just want to confirm this behavior is the same in the case of the protected Custom ...
0
votes
0answers
24 views

Can't able to delete meta data records in my dev org to delete/ uninstall a managed package

I have tried to uninstall a managed package from my dev org and got failed to remove the components because I had some custom metadata records to remove from the org. But when I try to delete those ...
1
vote
0answers
20 views

Creating custom field to via Metadata api, and adding it to layout

I added a field via Metadata Api to the Lead. It is not exposed via API due to the Field Accessibility. Since I am on Professional Edition, I have to control the Accessibility / Field Visibility ...
0
votes
0answers
53 views

How do I display multiple fieldsets on a vf page using apex:repeat?

I have a custom metadata type with the following fields: Fieldsets referred Object Name I have a requirement in which I need to show these multiple fieldsets on a vf page for that particular object....
0
votes
2answers
49 views

Using Metadata in triggers to remove hard coded keywords

I have custom metadata type with api name program_mdt in which I have created two fields called Email_Keyword__c and Body__c. In the below trigger I am trying to get rid of hard coded values in the ...
1
vote
1answer
36 views

Can I query custom metadata type record in a HttpCalloutMock?

I am trying to understand if I can make use of Custom Metadata Type record by quering it in a HttpCalloutMock this way: public HTTPResponse respond(HTTPRequest request) { String myString = [Select ...
0
votes
1answer
24 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 ...
8
votes
1answer
185 views

Custom Metadata SOQL WHERE clause not working

I'm getting some weird behavior with a SOQL WHERE clause on a Custom Metadata Type query: SELECT Id, Label, DeveloperName, Version__c, Content__c FROM My_Text_Content__mdt WHERE Version__c = '2020' ...
1
vote
1answer
441 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 ...
1
vote
2answers
68 views

Trying to update Values in Standard Object from metaData

Trigger is updated to Before UPdateI am using Trigger isBefore In System.debug(opp.get(metaData.get(0).Opportunity_Field_Name__c) it is showing correct Values but not Updating in Opportunity Object ...
0
votes
0answers
61 views

Custom metadata type multipicklist from values in another custom metadata type records

I have a setup where in one Custom Metadata type I deploy certain values and distribute that in a managed package. These are developer protected. Then, in another Custom Metadata type, i want the ...
1
vote
2answers
96 views

Generic function - Custom meta data type

I would like to do a generic function to get custom meta data type records and return it as a Map. In a first time with just one field , that means Map<String,String> and in a second time with ...
2
votes
2answers
110 views

Insert failing when populating boolean field with dynamic apex

We have a product configurator app that converts OpportunityLineItems to QuoteLineItems. We implemented a new solution with custom metadata relationships to dynamically map field values between the 2 ...
2
votes
1answer
199 views

Retrieve all Custom Metadata for a single type [duplicate]

Is it possible to somehow retrieve all metadata for a single custom metadata type via ant or sfdx mdapi ? I've tried this: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Package ...
2
votes
1answer
500 views

Using Custom Metadata Type in Email Template

I am wondering to know if it is possible to use a Custom Metadata Type inside an Email Template. I'm moving from Custom Setting to Custom Metadata Type and this feature could be great. Regarding the ...
0
votes
1answer
331 views

What are the real usage of entity definition relationships and field definition relationships in custom metadata types?

The trailhead here Configure your apps with custom metadata types proposes the following scenario: A custom medata type named Support Tier with default discount and minimum spending (Create and ...
8
votes
0answers
164 views

Metadata.DeployCallback is not called when deployment status is Fatal Error

BACKGROUND I am working on a feature that deploys custom metadata record. I am using a scratch org with a linked namespace. This is a my method which initiates deployment: @AuraEnabled public ...
0
votes
1answer
23 views

What options are available for defining record state (FSM) that will evolve through a process flow?

I'm developing a workflow for converting a lead into a customer with an ongoing service contract. The progress of process is governed by external factors checking out. I would typically use a finite ...
2
votes
1answer
37 views

Custom Meta Data - Hacking security

Is it secure to set as custom meta data, for example, Credit card details or any other sensitive data? Is there any existing option to encrypt this data ?
0
votes
1answer
22 views

Dynamically switch community login url between enviornments using apex

I need to send an email using apex that contains a link for the email recipient to login to a specific community. I'd like this link to change between my sandboxes and production. What appears to me ...
2
votes
1answer
512 views

How can I query the Created Date of a Custom Metadata Record?

I want to query the Created Date of a Custom Metadata Record. I'm trying this: SELECT Id, DeveloperName, CreatedDate FROM Interest__mdt ORDER BY CreatedDate LIMIT 1 But I'm getting this error: No ...
2
votes
1answer
148 views

Cannot update Custom Metadata records from Subscriber org in managed app

The custom fields are subscriber editable, and the custom metadata is not protected. I can update the field values in developer org in a managed app, but when I try to update in subscriber org in ...
2
votes
1answer
260 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 ...
2
votes
0answers
136 views

Cannot ORDER BY when querying Custom Metadata

I have Custom Metadata types with simple relationships between them. When I query them with a relationship query and try to ORDER BY, only 1 of the inner records is returned. I run this in Anonymous ...
1
vote
1answer
120 views

Insert or Update Custom Metadata Type Boolean Field

How, or can we, update Custom Metadata Types that have a checkbox field using the MDAPI? When I set it to '1' or 'true' in both instances it says value not of required type: <?xml version="...
1
vote
2answers
410 views

Would Refreshing a Sandbox Wipe Out Certain Metadata?

If I have custom-setting metadata (or any other custom objects) in a partial-copy sandbox and not in production, then I refresh the sandbox, will that metadata be wiped out and have to be recreated? ...
3
votes
1answer
612 views

Trigger: Find out the name of the object the trigger is firing for?

Is it possible for the trigger to see the name of the object it's firing for? Say can I make the OpportunityTrigger be aware that the object name it's firing for is Opportunity without hardcoding the ...
1
vote
1answer
342 views

How to do inline editing in pageblock table values

I am passing a list to the pageblock table and my table looks like below i want to edit the table values. I tried the below code. This is my VF Page code <apex:pageBlockSection id="section2" ...
2
votes
0answers
368 views

Cannot modify managed object: state=released: newValue='false', oldValue='true'

has anyone encountered and solved a sfdx force:mdapi:deploy error about changing a field from released to non-released? I'm getting this error when deploying to the packaging org. We've been working ...
4
votes
2answers
2k views

Reference Custom Metadata Type from Lightning Component

I added a new custom field to custom metadata object in Salesforce. That field (Icon_URL) is a text value that will be used to point to the location of custom icons. I want to be able to reference ...
2
votes
0answers
83 views

Reproducible? Cannot Add Custom Metadata Record to Change Set if it References Id Field?

I have a Custom Metadata Type which contains a field mapping. There are four basic fields which seem relevant to this situation (though you could likely boil it down to just two): Source Object (...
3
votes
2answers
425 views

What is the best practice to store custom configuration for a managed package application?

We are working on an application in managed package, and we need to store app configuration. Generally, we want to allow users to turn on/off some features in our app. For example, on the settings ...
2
votes
1answer
121 views

Can you dynamically instantiate a Custom MetaData object in the same dynamic way you can an SObject?

With SObjects we can do something like: sObject sob = [Select id,name from Account limit 1][0]; Can you do the equivilent with Custom Metadata? For example does something like this exist: ...
4
votes
1answer
221 views

Get components of a compound field?

I am currently running into this limitation of Custom Metadata: Custom Metadata Relationships and Compound Fields Since it is still not possible to relate a record to a specific EntityParticle (e.g. ...
4
votes
2answers
188 views

How to load configuration from custom meta data

I'm new to Salesforce, though an experienced Java developer and I'm trying to load my App's configuration using the recommended method of custom meta data. I've found this quite poorly documented ...
2
votes
2answers
262 views

How to list all the metadata that is changed after a given date

how to get all the metadata changes after a given date. Tried using metadata api's listMetadata(), this gives all the data and here we can't filter using dates. This will run into limits for reports ...
0
votes
1answer
46 views

Deployment Connection of Source Org is not Showing

I am trying to push my custom objects files from my source org to target org through changeset but deployment connection of source org is not showing in the target, I have created a sandbox too of my ...