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
1answer
34 views

How to overcome Salesforce System Error when deploying from Apex Code more than 1488 Metadata Records?

Conversion process of custom object records into Custom Metadata records using Metadata.Operations class enqueueDeployment method fails if deployment container contains more than 1488 records. ...
0
votes
1answer
14 views

How to update a package in test environment after I changed it in development environment?

How to update a package in test environment after I changed it in development environment? After creating a package I forgot to add a few records of a specific Custom Metadata Type. Now I went to the ...
2
votes
0answers
35 views

Cannot provide null for an SObjectField custom metadata record field via Metadata API

We're trying to update Custom Metadata records using the Custom Metadata API from Apex. The record has a field of type SObjectField. When we create we can omit this field and the result on the ...
19
votes
1answer
198 views

Are Custom Metadata Types considered External Data Sources?

Back in 2016 we created a Custom Metadata Type with about 3000 rows. There is a trigger that reads all 3000 rows (via SOQL) and creates a map. This has been working for years, until Winter '19. Now, ...
0
votes
1answer
864 views

How to query a Text Area or Text Area (Long) in Apex using SOQL

I created a Text Area field in Custom Metadata and I'm trying to SOQL that field but I get NULL. List<CustomMtd__mdt> customMtdList = [SELECT textAreaField__c FROM CustomMtd__mdt LIMIT 1]; ...
5
votes
0answers
87 views

How to improve performance when querying CustomMetadata's FieldDefinition fields

When I query string columns on custom metadata objects, I get decent performance. However, if I query a column that points to a FieldDefinition, my query became much slower. Is this a known system ...
2
votes
1answer
490 views

Is it possible to create a report (type) for custom metadata?

Custom metadata (types) looks like a cool feature. I have created dozens of instances of one that I made and now I would like to create a report on them, because a list view is not good enough. So ...
2
votes
1answer
225 views

Check picklist value in apex code - just check api name or create custom metadata?

In my apex class and trigger code I have If statements based on picklist values. Using picklists in code I know uses the api name of the picklist value. My question is, is it ok to just use the api ...
2
votes
1answer
152 views

Do custom metadata types not support COUNT(fieldName) with a GROUP BY?

Question title covers most of it. Here's a sample query and the error I receive in response: SELECT COUNT(Id) FROM MyCustom__mdt GROUP BY MyField__c field Id does not support aggregate operator ...
3
votes
3answers
2k views

Check if User has Permission to update Custom Metadata

I'm building Visualfroce for updating Custom Metadata. When User without required permissions tries to update them he gets I tried checking MetadataType__mdt.getSObjectType().getDescribe()....
1
vote
2answers
2k views

How to delete Custom MetaData Records Via Apex?

I am using MetaDataService to create and update Custom Metadata. I want to also delete records created inside Custom Metadata Type. I know there is method available to delete metadata like I am ...
-2
votes
1answer
17 views

How can I reconstruct this If condition

Currently we have hard coded the states **private static Set<String> allowstates = new Set<String>{'California','New Hampshire','New York'};** if (!allowstates.contains(bank.State__c)) { ...
0
votes
1answer
270 views

Can you change required field to not required for a custom metadata's page layout?

According to the following documentation, after you upload a Managed - Released package that contains a custom metadata type, you can’t: Add required fields to the custom metadata type. Set non-...
1
vote
2answers
587 views

Custom Metadata records Sandbox refresh

If I create Custom Metadata records in prod, and then I refresh my sandbox, will the Custom Metadata records I created in prod now be in my refreshed sandbox? I'm considering migrating to a custom ...
0
votes
1answer
227 views

Permission Set to Restrict Access to Managed Package Specific Custom Metadata

We have a managed packaged that ships with a Custom Metadata property and an "Editor" that allows users to modify the Custom Metadata fields and create new ones. We would like to include a permission ...
0
votes
1answer
45 views

Compare field to large list within Salesforce

I have a large list of email domains that I would like to use for comparisons within some apex code (for example, does the Contact's email domain name exist in this list). What is the best practice ...
2
votes
1answer
36 views

Use order by clause in cross -object metadata relationship

Is there a workaround to handle order-by in cross-Object metadata relationships? So Here is the querry. SELECT Id FROM Child__mdt ORDER BY Parent__r.Order__c ASC where Parent and Child are the ...
0
votes
0answers
421 views

Update Custom Metadata

I am trying to update some custom meta records. There are current 4384 records in the system. And update give me an error of "Collection size 4,384 exceeds maximum size of 1,000." This happens even if ...
5
votes
0answers
244 views

Unable to query with cross-Object pick-list field filter on Custom Metadata SOQL

I came across something weird, SOQL which has a filter as cross-Object picklist field doesn't return rows, even if records exist. Minimum viable code to replicate: Create a new custom metadata type, ...
3
votes
1answer
305 views

Beta Package (Not allowed to install metadata via apex)

I have a beta-managed-package the when deployed has a Apex Metadata API call out that allows users to modify some Custom Metadata that is shipped via the the code. It also allows them to create new ...
1
vote
1answer
2k views

Export all Custom Metadata Types details in csv

Recently took over the instance as admin. Previous instance is managed by an outsourced development team. There are 3 picklists that are controlled by custom metadata types and apex trigger. Not ...
2
votes
1answer
170 views

Testing Metadata Using Mock Call Outs to Static Resources

I have a class that is called before the handler method of a trigger to check and see if a Custom Metadata Field is checked and therefore the code in the trigger handler should not be run. I can ...
7
votes
1answer
264 views

Design Dilemma - Custom metadata Types

I was trying to solve a problem with access and refresh tokens across multiple businesses in a single org and thought I would use Custom metadata Types. The main reason was the field length can be > ...
1
vote
1answer
2k views

How to Retrieve & Deploy Salesforce Lightning Theme using metadata api?

We created a custom Lightning Theme (Setup > User Interface > Themes and Branding) in the sandbox and have to push it to another org using Metadata API. We were able to retrieve Branding Set from ...
0
votes
1answer
85 views

Add or Edit Custom Metadata Records Declaratively requires CustomizeApplication, any Visualforce workarounds to allow regular user this ability?

I'm currently using visualforce and apex to allow a user to manage their own Hierarchical Custom Settings. By design this allows non-admins the ability to edit their Hierarchical Custom Setting values ...
2
votes
1answer
2k views

Retrieve/Deploy a custom metadata type's list view?

I'm trying to deploy a list view for a custom metadata type using the Force.com Migration Tool, but I am unable to locate the ListView to include in my package.xml retrieve. I have deployed many ...
0
votes
1answer
66 views

How to hide managed package test-only Custom Metadata records once the package is installed?

The advice in Testing Custom Metadata Types is to add metadata records for unit tests if necessary. We need our managed package customers to be able to add additional records, so having the test-only ...
0
votes
0answers
177 views

Translate custom metadata into a math operation

EDIT: I am sorry for the poor description. I tried editing it to make it more clear. I have an API that will accept several parameters. At the moment I need to perform a math operation using those ...
0
votes
1answer
775 views

How to use custom metadata in validation rule? [duplicate]

How to use a custom metadata records checkbox field in validation rule over a custom Object? Is there any way?
0
votes
2answers
3k views

Parse custom metadata in lightning component

I'd like to display 5 different values from a custom metadata type in a lightning component. Instead of doing 5 different Apex methods, I'd like to return them all at once and then display the values ...
0
votes
1answer
400 views

update custom metadata types :getting error

I need to update the value in custom metadata type when ever the class called/invoked. I am getting error like field is not writable even though permission is there,here family id is number data types ...
6
votes
1answer
506 views

Remove Custom Metadata w/ Custom Metadata API

I am attempting to remove some custom metadata, I am able to deploy it, and view a successful result, but when I create a new Metadata.DeployContainer container, and use the container.removeMetadata ...
5
votes
1answer
125 views

Packaging org: Deleted custom metadata records

My company is in the final stages of a project where we developed (using DX but 1st generation packaging) a managed package for the customer. This week is the first time we're actually packaging it up ...
6
votes
2answers
2k views

Custom metadata type not accessible after installation with sfdx

I create an app using sfdx and at one point I convert it as a package using: sfdx force:source:convert --outputdir mdapi_packageName --packagename packageName and installing on a (other) org using ...
1
vote
1answer
942 views

Custom Metadata Manipulation in APEX

I am attempting to do some DML on a Custom Meta Data record, to allow users to have some "Defaults" when a managed package is installed, that we would also like them to be able to manipulate (and save ...
2
votes
1answer
160 views

Custom Metadata Contact FirstName and LastName not available

I am using custom metadata with a field of type Metadata Relationship(Field Definition) to provide the config side of an app, however when selecting Contact as the object I cannot find the FirstName ...
1
vote
1answer
149 views

custom metada type - checkbox field value

I am unable to mark custom metadata type's field of type checkbox to true from apex code. public class PRTestCtrl{ @AuraEnabled public static void saveCMD() { // Set up custom metadata to be ...
0
votes
1answer
437 views

Custom Metadata Types - RecordType

I have created a Custom Metadata Type that has a field with a relationship to EntityDefinition(object). This EntityDefinition here suggests a field RecordTypes, but it is available only in the ...
3
votes
1answer
3k views

Use Custom Metadata as lookup instead of hard coding

I've now read so many articles on Custom Metadata my head is spinning. Can someone give me a simple answer please as to how to use this instead of hardcoding a check for a value? I have a custom ...
-2
votes
1answer
70 views

Read Custom Meta Data in VFP tags without Controller

Just checking if we can read Custom Meta data in VFP just like custom Label without using Controller class. If its not possible then please let me know few examples of reading meta data in VFP using ...
1
vote
0answers
39 views

Remove actionOverrides to managed packages

I want to set a flexipage as an org default by adding an action override to Case.object-meta.xml: <actionOverrides> <actionName>View</actionName> <content>Case_Record_Page&...
2
votes
2answers
828 views

Custom Metadata Record Size

I have designed a feature that uses a Custom Metadata Type to facilitate page layout updates when the package is updated. To test this process I am having to create "test" Custom Metadata records that ...
0
votes
2answers
248 views

Scope of Validation Rule Formulas with Custom Metadata Types features

I am looking for solution to enable formula reading for Custom Setting List.I know that for Custom Setting Hierarchy we able to read it from formula. The only work around is using trigger/apex to ...
4
votes
1answer
121 views

Remove property from metadata using packaging 2

We're using packaging 2.0 (SFDX) to develop and create our package, but have made a mistake and wound up with <externalSharingModel>ReadWrite</externalSharingModel> in a custom object. ...
2
votes
2answers
85 views

Open up access for managed package subscriber

I am developing my first managed package where the default installation will be free and will provide access to some data. And if a user wants to go Paid, he will have access to additional data. ...
1
vote
0answers
1k views

Can't create list custom settings (have they been deprecated?) [duplicate]

The option to select the "List" type on the new custom settings screen is not available (disabled and set to "Hierarchy.") I see a notification to use Custom Metadata types, however they will not work ...
0
votes
2answers
9k views

How do I insert records in Custom Metadata Type through Apex?

I want to write a trigger on a custom object (Template__c) such that it invokes the creation or update of Custom metadata type records. Since the fields are not writeable, how do I achieve this? I ...
1
vote
1answer
178 views

Store Formula in String Field and Convert to Datetime?

I am working on building a rules processor and have a text (string) field in a custom metadata type that I would like to store a formula in (i.e. datetime.now()) and then convert to the correct field ...
3
votes
1answer
1k views

Unable to migrate Custom Metadata settings using ANT in salesforce

I was looking to Migrate the Custom Metadata settings from Dev to SIT box. For that I created the following package.xml. I have total 5 different custom metada setting <?xml version="1.0" encoding=...
0
votes
2answers
550 views

Error: Header must contain atleast one of these two fields - DeveloperName, Label

Error: Header must contain atleast one of these two fields - DeveloperName, Label. on uploading data through custom metadata loader. even i have Label as the first column, it still throws this error