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
0 votes
1 answer
18 views

Not able to insert records in custom metadata

I have used this sfdx cmd to execute the mass record insertion in custom metadata. sfdx force:cmdt:record:insert --filepath CountryMapping.csv --typename CountryDialingCodeMapping__mdt I am getting ...
blackFire's user avatar
1 vote
0 answers
32 views

Custom Metadata Lookup

I am trying to see if I can create a lookup to custom metadata rather than using a Case or series of IF statements. As a test, I tied to create a formula field as follows: $CustomMetadata....
J. Neilan's user avatar
  • 1,243
0 votes
0 answers
27 views

What could cause a apex scheduled batch class to run but not update records even when unit tests have passed?

I spent hours troubleshooting my batch class but I cannot get it to update records. The ask is if a Opportunity closeDate >15th of the month, and CareStatus__c = 'ADM','AAMT' than ...
LegendofLegends's user avatar
0 votes
1 answer
34 views

How to Include Custom Metadata with Records in Second-Generation Package?

I'm currently working on packaging an application using second-generation packaging in Salesforce. As part of this process, I need to include custom metadata records along with the packaged components....
chanchal kumar's user avatar
0 votes
0 answers
64 views

Not allowed to install or modify metadata via Apex

I know that this error is a hot topic and case for Salesforce but I tried to bypass this using some code workaround. Here is the code that I tried: // Upsert method call try { ...
batuayyildiz's user avatar
0 votes
0 answers
17 views

Unable to reference custom metadata type while creating 2GP managed package. Visibility of custom metadata is set to package protected

I am creating a 2GP managed package, wherein I have a custom metadata object with name cred__mdt. I am quering this metadata from apex. My app is an LWC component which communicates with external ...
Snehal Wankhade's user avatar
0 votes
0 answers
38 views

Custom validation rule - for unique value

I'm using Custom Metadata Types and writing validation rule to find if this combination has uniqueness if it's (meaning its a duplicates) then throw an error here is what I was able to do but I'm ...
Nick's user avatar
  • 7,012
0 votes
1 answer
38 views

Custom Metadata Types Relationship

I want to create a Custom Metadata Types field using the Metadata Relationship that links this custom metadata type to Profile object, is that even possible ? if yes can you please show me how would I ...
Nick's user avatar
  • 7,012
0 votes
1 answer
65 views

Can you query object data against a custom metadata type?

Is it possible to query an objects data against a custom metadata type? For instance, I'm working on a data cleanup project and need to find every lead where the value in the State field is not one of ...
Nick's user avatar
  • 13
0 votes
1 answer
33 views

How come get(field_name__c) works with the values returned from CustomMetadataType__mdt.getAll().values()?

I have something similar to following: for(CustomMetadataType__mdt config : CustomMetadataType__mdt.getAll().values()){ //we usually use this to access the field values System.debug(config....
Borz998's user avatar
  • 23
0 votes
0 answers
99 views

How to update Custom Metadata Type records with JSforce

I am working on a node.js script where now I aim to update a Custom Field of a Custom Metadata Type record. So far, I have tried few different things, all of them without success: await connection....
Gabriel Serrano Salas's user avatar
1 vote
1 answer
209 views

How to restrict users accessing the Custom Metadata Type Record?

We are building a application which required a Public Custom Metadata Type. We have a Screen flow which has an LWC Component which calls an Aura Enabled Method of a public with sharing class. In this ...
S1th's user avatar
  • 133
0 votes
1 answer
99 views

How to determine when Queue is complete on LWC

I'm currently trying to create a tool that creates a metadata record in LWC. I'm using Metadata.Operators.enqueueDeployment(mdContainer, new DeployCallback()) to create a new record, and it's able to ...
Kevin Yao's user avatar
  • 117
-1 votes
3 answers
246 views

How to retrieve the object data from Custom metadata types

I am trying to retrieve the records from custom metadata types objects but in data loader it is not showing up
venkatesh A's user avatar
2 votes
1 answer
63 views

CMDT references in a formula field breaks rollups?

I have a formula field that is rolled up in a parent object. The field is of this form i.e. constants for the case values: <formula>IF ( ISPICKVAL(Status__c , &quot;...
Keith C's user avatar
  • 136k
1 vote
1 answer
139 views

Accessing value of a package-protected custom metadata type record from Apex

I have created a package-protected custom metadata type (sf_Assistant_Settings), a field (Value) and a record (API_Key). I use it to store an API Key which is used when making http requests to an ...
LoMaPh's user avatar
  • 73
0 votes
0 answers
166 views

How check if picklist value contains in Custom metadata in LWC js?

I'm trying to check if the input selected picklist value exist in custom metadata, then I'm trying to display some records. I have implemented the below code but records are not displaying. Is there ...
Basha's user avatar
  • 5
-1 votes
1 answer
551 views

What is the major difference between Custom Setting and Custom Metadata?

I have gone through various articles for the difference between Custom Setting and Custom Metadata but I couldn't find the major difference why we should setting over metadata or metadata over setting....
Hira Khan's user avatar
0 votes
1 answer
438 views

Deploy custom metadata records from one sandbox to another with Apex

I have a situation where I would like to deploy records of custom metadata types from one sandbox to another through Apex. The reason for using Apex is that there will be a lot of records under the ...
Michael Munta's user avatar
0 votes
0 answers
87 views

Duplicate value on record: on Custom Metadata for deleted record

I have a managed package, beta version, installed in an org. There is a Custom Metadata type with a custom field that is set to Unique Values. I created a record and had a unique value of '15' in that ...
awh01's user avatar
  • 139
-1 votes
1 answer
261 views

Create a JSON using Custom metadata type [closed]

I have a custom metadata which store some parameters which I need to pass in Post callout.I have stotred the Options in below JSON in that custom metadata { "email": "[email protected]&...
Buhuni's user avatar
  • 9
0 votes
0 answers
95 views

Translation of Record Name value

I have an Object A with a lookup field to Object B and a Language__c field. I would like to create another field on Object A to display the record name value of the record from Object B in a correct ...
mascot's user avatar
  • 583
-1 votes
1 answer
461 views

Custome Metadata getAll() vs SOQL query

I have checked in official documentation that we can use getAll() method to query all metadata records. My apprehension is that does it actually run a SOQL in the background and consume the governor ...
Manuj Pandey's user avatar
4 votes
2 answers
216 views

Packaged CMDT record fails to update even for Sysadmin

Note: There is a related Salesforce Support Case #45059901 Convinced by the answers of some real ISV experts, I refactored my Managed Release Package from ugly Custom Settings to Custom Metadata with ...
Robert Sösemann's user avatar
0 votes
1 answer
87 views

Is there a way to retrieve metadata (Label) of all Mobile & Lightning Action - Metadata.Operations

right now I'm using Metadata calling from Apex. Apex code: public static List<String> getPageLayoutInfo(Id recordId) { String sObjectType = recordId.getSObjectType().getDescribe()....
Pam's user avatar
  • 107
1 vote
2 answers
213 views

Store settings and API credentials in packaged CMDT records

My current Managed Package supports a single GPT API and covers that with multiple packaged components: Protected Custom Setting for secure storage of API credentials (Named Creds don't work) Custom ...
Robert Sösemann's user avatar
0 votes
0 answers
38 views

Magento 2 automatic token saving

I would need to reduce the token return calls of Magento 2 from this class. I would have already thought that I could perform this by going to save and history the token within a custom setting. and ...
Toris's user avatar
  • 17
1 vote
2 answers
759 views

Mass insert custom metadata records command 'sf cmdt generate records' throws error The column Name is not found on the custom metadata type

I am following the documentation here : cmdt command Salesforce CLI precisely this command : sf cmdt generate records --csv path/to/my.csv --type-name MyCmdt I am using a csv file with the first ...
Chris's user avatar
  • 316
-1 votes
1 answer
215 views

Storing a table with multiple value data in custom metadata types

I have a table with two columns. One column is a role and the other are keywords associated with that role. For example: Roles Keywords Admin Desk, Forms, Data Entry HR People, Communication What ...
eHarazi's user avatar
  • 155
0 votes
1 answer
125 views

get metadata as *.object, not folder structure

How do i retrieve metadata, as .object files? Currently what i do is: use workbench or Package xml Generator to create a package.xml like this <?xml version="1.0" encoding="UTF-8&...
Luis Aguiar's user avatar
0 votes
1 answer
354 views

When using getAll to get the value of a field from custom metadata I am getting null instead when I use query, I am getting the result

CustomMetada__mdt metaDataRecord = CustomMetada__mdt.getAll(); for (SObjectField field: metaDataRecord.getSObjectType().getDescribe().fields.getMap().values()) { System.debug(field.getDescribe()....
Yadhu Krishnan's user avatar
0 votes
0 answers
205 views

Storing tokens for custom token management

I'm working with an API that does not follow typical OAuth standards and requires custom headers for passing the token. Typically I would use Named Credentials, but due to the atypical pattern it is ...
S.B.'s user avatar
  • 2,071
2 votes
6 answers
2k views

Custom Metadata Type Records Mass Insert

Trying to mass upload custom metadata type records using cmdt commands. The following was working but now it stopped. I keep getting this error: 'The column Name is not found on the custom metadata'. ...
Dmns's user avatar
  • 21
1 vote
1 answer
679 views

How to mock, inject or otherwise make Custom Metadata available to apex tests

I have some code which relies on some Custom Metadata records to exist, but I don't want my tests to depend on real records in the org. How can I either inject or mock custom metadata records into ...
ministe's user avatar
  • 324
0 votes
1 answer
43 views

Use Standard Apex Method UserInfo.getUserEmail() in Custom Metadata

I want to move below collections into Custom Metadata private static Set<String> validAddresesForGoogle = new Set<String>{ '[email protected]', '[email protected]', ...
abhay gupta's user avatar
0 votes
0 answers
145 views

CMDT CSV Insert Problems

Am trying to insert new records for a custom metadata file and saw that force:cmdt:record:insert has been deprecated. I tried sf cmdt generate records --csv path/to/my.csv --type-name MyCmdt but VS ...
Dmns's user avatar
  • 21
1 vote
1 answer
117 views

Any way possible to move multiple Set<String> into Custom Setting or Custom Metadata?

As my firm expands, I may have numerous Set that can each hold N different values. I want to move these Set values out of Apex and into Custom Settings or Custom Metadata, but there isn't a field for ...
abhay gupta's user avatar
0 votes
0 answers
43 views

Custom Metadata Update does not run QueuebleHandler in Metadata.DeployCallback when called from extended Auth.AuthProviderPluginClass

I am trying to update a Custom Metadata record using the following code, which works perfectly well when run as an Anonymous user through the development console: public class SageMetaDeploy ...
wmin's user avatar
  • 69
0 votes
1 answer
139 views

How to include custom metadata records when building a release artifact with the salesforce CLI

Im trying to generate a release artifact by converting some source files to metadata format so I can deploy it with the following command: sfdx force:mdapi:deploy... this is the command I'm using for ...
Giovanni's user avatar
1 vote
0 answers
320 views

Mass Insert Custom Metadata Type Records

I'm using Salesforce CLI to import 5000 records of a custom metadata but I wasn't able to to import Label and DeveloperName together and I saw that is a limitation, so I tried utilize only Name but in ...
Alexia's user avatar
  • 79
1 vote
1 answer
62 views

Custom metadata types clever trigger possibility

Is there any way to cause a triggering event on custom metadata types? I know there is this idea, which is not implemented. I have a use case where I need a country list stored (can create custom MDT) ...
SEuser's user avatar
  • 1,855
0 votes
1 answer
79 views

CODE BEST PRACTICE - Calling the custom metadata check from every method in Trigger

I had previously asked how to write test class to cover custom metadata in Test class coverage required for Custom metadata that turns a Trigger on and Off and found solution from the answers. As a ...
Abhinandana 's user avatar
-1 votes
1 answer
336 views

MetadataService API custom field label update

Recently I am building a side project myself to allow user mass update custom fields label. Currently, you can only do that one at a time. The POC looks good, I am able to achieve that with text and ...
Wayne Ni's user avatar
  • 609
0 votes
2 answers
641 views

Test class coverage required for Custom metadata that turns a Trigger on and Off

can some one tell me how to cover custom metadata in test class? in particular if (Trigger_Disabler__mdt.getInstance('Account_Disabler')?.Disable_Trigger__c == true) line in the code below. Context ...
Abhinandana 's user avatar
2 votes
2 answers
2k views

GetInstance not returning whole value in Long Text field from Custom Metadata

I am querying a long text area field from custom metadata using GetInstance and it is not fetching complete value. Can somebody please tell me what is the reason?
Uditchawla's user avatar
0 votes
1 answer
322 views

How to use AuthProviderPluginClass in managed package?

I am trying to create custom Auth. Provider for my managed package. Class extending Auth.AuthProviderPluginClass works well in namespaced scratch org, but when packaged and installed in sandbox I am ...
Michał Piątek's user avatar
0 votes
0 answers
66 views

Metadata Types access from package

I'm facing with following error: Developer script exception from Org_Name : 'prefix.AnyClassName' : Access to entity 'prefix__Some_Metadata__mdt' denied: Entity is not api accessible I have a ...
Igor Vasylevskyi's user avatar
1 vote
2 answers
132 views

Automate or simplify post-install steps for Packaged Flows

I am planning to add a few Flows to my Managed Packages. E.g.: Record Triggered Flow Templates that detects certain conditions Screen Flows that define UI for Slack notifications sent out from 1.) ...
Robert Sösemann's user avatar
0 votes
1 answer
122 views

Salesforce Custom metadata edit access

Is there any way to provide edit access to records of custom metadata, but without Customize Application permission. Customize application gives really wide access and we want to avoid it, but till ...
michal98kowalczyk's user avatar
0 votes
4 answers
1k views

Error updating metadata via Apex

I have an issue, I created a CMT to store a token for a integration with thirdparty system, with the SA user works fine, but it doesn't work for other users, when I check the debug logs I saw this ...
Angello Camacho's user avatar

1
2 3 4 5
9