Skip to main content

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
35 views

How to edit an invalid Custom Metadata ListView

Custom Metadata ListView allowed me to save a list view that was invalid. What made it invalid was putting 2 values in a RHS box - metadata queries do not support ORs like regular objects do. When I ...
Maggie's user avatar
  • 336
0 votes
1 answer
79 views

Would it be advisable to put the Custom Metadata Type records in a Wrapper Class?

I have a code that is dependent in metadata records. Let's say if my object record matches the value in metadata record then it will do something. However, the requirement is getting bigger and we're ...
Saberzero's user avatar
0 votes
1 answer
62 views

Metadata Relationship to the same custom metadata type

I want to link the same custom metadata type to itself using Metadata Relationship. Example: Metadata api name: My_Custom_Metadata__mdt Metadata Relationship: Parent__c I want to connect ...
Arthlete's user avatar
  • 5,039
0 votes
1 answer
63 views

I can insert but not update custom metadata

I am just updating the time in formula (long text field) for the test { "attributes" : { "type" : "Approval_Criteria__mdt" }, "DeveloperName" : "...
KarlLivesey's user avatar
0 votes
0 answers
73 views

Is it possible to delete managed records from a Custom Metadata that have been deployed?

For our 1st generation package we have accidentally deployed records for a particular custom metadata (___md). They are Managed records. So navigating to the metadata records has no "Del" ...
PieterJacob's user avatar
0 votes
2 answers
34 views

Truncated CMDT getInstance()

I am curious - when using a long text field for a CMDT and you run the getInstance() method on the CMDT to pull all of the values for a specific record...is there a character limit for the getInstance(...
Olivia's user avatar
  • 3,491
0 votes
0 answers
25 views

Deploying prefixed metadata with DevOps Center/CLI: "Only components in the same namespace as the organization can be created through the API"

I'm trying to wrap my head around how metadata-driven deployments (e.g. through DevOps Center or the sf CLI) can coexist with metadata created by managed packages. For example, our org installed the ...
Stephen Funk's user avatar
0 votes
0 answers
89 views

How to Address Security Warnings About Named Credentials When Handling OAuth in Apex?

I am preparing to submit my Salesforce application for review to list it on Salesforce AppExchange. My application uses a custom OAuth authentication flow handled by an LWC component and Apex. The ...
Bruno F's user avatar
0 votes
1 answer
36 views

How to verify a custom metadata type relationship field's datatype

I have a CMDT SObject called MyCmdt__mdt It has two fields Field Name Field Type SObjectType__c Metadata Relationship (Entity Definition) SObjectField__c Metadata Relationship (Field Definition) I ...
cropredy's user avatar
  • 73.2k
1 vote
0 answers
63 views

Error Saving Custom Metadata: could not find fields: Label, Language

I'm receiving an error every time i try to update custom metadata. The error says could not find fields: Label, Language Metadata.DeployContainer mdContainer = new Metadata.DeployContainer(); ...
Muhammad Refaat's user avatar
1 vote
0 answers
132 views

Flow Custom Metadata in Entry Conditions causes Problems on Lead Convertion

We have a Custom Metadata called Flow Setting where we can enable and disable based on the Object the Update or Creation. Previously we had no Entry Conditions for the Account Flow and inside the ...
Simon Agethen's user avatar
0 votes
2 answers
115 views

Custom metadata behaves differently for standard and custom objects

When using a custom metadata type with Metadata Relationship fields, the actual values written to the database are different for standard and custom objects. Consider a custom metadata type ...
drmacm's user avatar
  • 3
0 votes
1 answer
164 views

Bulk Update Custom Metadata Records

Are there any sfdx/sf CLI commands to bulk update the Custom Metadata Records via VS Code? I can able to see only create commands in the Salesforce documentations. Thanks In Advance!!
SilverWing's user avatar
-1 votes
1 answer
161 views

Batch and custom metadata

if we are running the batch using the custom metadata and if we are changing the custom metadata while the batch is in execution is there any impact on batch. XyzBatch obj = new XyzBatch(); database....
Prabhat Pandey's user avatar
0 votes
2 answers
109 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
107 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
30 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
64 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
182 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
51 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
155 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,153
0 votes
1 answer
69 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,153
1 vote
1 answer
178 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
  • 23
0 votes
1 answer
36 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
  • 101
0 votes
0 answers
307 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
609 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
  • 153
0 votes
1 answer
422 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
  • 167
-1 votes
3 answers
582 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
101 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
  • 137k
1 vote
1 answer
270 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
  • 83
0 votes
0 answers
290 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
  • 15
-1 votes
1 answer
2k 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
925 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
152 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
  • 141
-1 votes
1 answer
465 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
237 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
  • 593
0 votes
1 answer
2k 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
249 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
115 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
251 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
2 votes
2 answers
1k 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
  • 406
-2 votes
1 answer
371 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
  • 151
0 votes
1 answer
325 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
577 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
392 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,141
2 votes
6 answers
3k 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
2k 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
  • 344
0 votes
1 answer
70 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
1 vote
1 answer
175 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
49 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

1
2 3 4 5
9