Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [custom-metadata]

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

0
votes
1answer
39 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 ...
1
vote
1answer
17 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 ...
1
vote
0answers
10 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
32 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
28 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
141 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
125 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
56 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
71 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 ...
3
votes
2answers
163 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 ...
1
vote
0answers
26 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
156 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
25 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
66 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
97 views

How to load configuration from custom meta data

I'm new to Salesforce, though 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 with ...
1
vote
2answers
51 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
30 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 ...
4
votes
1answer
69 views

Qualified API Name returns null in Test context for Custom Metadata

Winter 19 release provides ability to instantiate the custom metadata in apex .This seems to be useful to generate data for test classes . However when we have metadata relationship entity or field ...
1
vote
0answers
114 views

Alternative to custom settings in salesforce

I have a problem statement where I need to store a list of some 40 Parent Objects Ids statically. Further, if any one of the Parent Object's child records goes higher then 45,000(which is calculated ...
1
vote
2answers
627 views

Update Custom Metadata with Apex in my org

In the documentation it says Apex code can create, read, and update (but not delete) custom metadata records No where in the guide do I see apex being used to update custom metadata, only to ...
0
votes
1answer
26 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
0answers
19 views

Geolocation fields in Metadata

I have a bunch of postal codes in a metadata object (where they belong). Now I want to add a Geolocation field to this object but it seems I'm not able to choose this type. Is it even possible to use ...
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
25 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 ...
18
votes
1answer
161 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
359 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
40 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 ...
1
vote
0answers
144 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
78 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
42 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 ...
1
vote
3answers
809 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
527 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
15 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
59 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
267 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
102 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
31 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
25 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
139 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 ...
0
votes
0answers
74 views

Evaluate the static resource url stored in a field of the record of the custom metadata type

Is it possible to evaluate the static resource url stored in a field of the record of the custom metadata type? For example I have the following record: After querying the value of the field Static ...
5
votes
0answers
126 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
135 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
673 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
104 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
172 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
768 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
44 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
873 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
44 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
88 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 ...