Questions tagged [metadata-api]

Questions about the Metadata API provided by salesforce. The API that can be used to retrieve, deploy, create, update or delete customization information, such as custom object definitions and page layouts, for your organization. This API is intended for managing customizations and for building tools that can manage the metadata model, not the data itself.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
42 views

Using the API and Deploying Apex Classes

Either using the tooling or the metadata api is there a way to upsert Apex json classes into a target organization. We would like to avoid using any XML based deployments. As an engineer, I would like ...
  • 119
0 votes
1 answer
54 views

Adding a value to a picklist field of an entity in an org via apex

All, I am trying to add a value to a picklist field of an entity (i.e. Document Attachment Status of Care Request Extension ) via apex class in my org only. I tried following approaches but those are ...
0 votes
1 answer
45 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 ...
  • 594
3 votes
0 answers
50 views

Can I get flow interview details using APEX/Metadata/Tooling API for any specific record?

My Use case: I have created a trigger flow on Lead to run after 3 days of lead creation. I want to show the interview status in a LWC component Users can pause/reschedule interviews from the LWC ...
1 vote
0 answers
45 views

Failure to deploy Experience Cloud Site with Metadata API - no network named XXX found

I'm following the Salesforce documentation Deploy Your Experience Cloud Site with the Metadata API. I am using a simple site created from the Customer Account Portal Template as a test case before ...
1 vote
0 answers
35 views

Add FLS to custom fields of Activity (Task/Event) in bulk from workbench

I created about a 100 custom fields for Activities in bulk using metadata API via workbench. Now I have to manually Set FLS for each custom field one by one for Activity from the UI, which is a time ...
-1 votes
0 answers
19 views

Destructive Changes Flow Interviews

I am trying to delete inactive flows via a script I wrote for destructive changes and the first go around deploying it I got a handful of flows/flow versions that were not deleted due to them being ...
0 votes
1 answer
34 views

Salesforce createMetadata fails with INSUFFICIENT_ACCESS_ON_CROSS_EREREFERENCE_ENTITY

We are trying to create a custom field on lead object using metadata api, But it fails with the error "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY". We have checked the permissions for the ...
0 votes
0 answers
22 views

Workbench Metadata API deployment Failed : Error - This View Unique Name already exisits or has been previously used. Please choose different name

I am trying to deploy a custom List View (My Sales Leads) of the Lead Object. It throws the error of being a non-unique List view name. If I change the List view scope to any other List views and then ...
  • 1
3 votes
1 answer
136 views

Deactivating a Salesforce Flow via the Metadata API

It is my understanding right now the only way to deactivate a Salesforce flow is to retrieve the FlowDefinition file and set the active version number to zero Is using workbench or VS Code the only ...
  • 119
0 votes
2 answers
202 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 ...
-1 votes
3 answers
69 views

How can I change Apex code and a field that it references?

I am making changes to an Apex class that directly references a field on an object. Alongside this, I would like the field to be renamed. I've tried adding the new renamed field to the change-set and ...
0 votes
0 answers
22 views

Metadata Service API not able to update picklist depedency

We have 3 picklist dependent upon each other: Category (Mandatory) Type (Mandatory) Subtype (Not mandatory) For each picklist, we have lot of picklist values which consumes lot of time mapping via ...
  • 83
0 votes
0 answers
30 views

Metadata API Deployment Unit Test Results, CodeCoverageResult.dmlInfo is always null

Trying to build a report of Deployment metrics with Metadata API. The documentation says that the CodeCoverageResult object should contain performance metrics for DML, SOQL, and methods which is ...
2 votes
0 answers
46 views

Get OAuth scopes for managed apps using API

I am exploring the Saleforce API in order to obtain the OAuth scopes for connected applications. As an experiment, I created two connected apps: Create a connected app manually say App1 by clicking ...
0 votes
0 answers
67 views

Getting UNKNOWN_EXCEPTION while updating SharingCriteriaRule using Metadata API

I am trying to update the access of SharingRule using the Metadata API from APEX. I have created a MetadataService class using https://github.com/financialforcedev/apex-mdapi/blob/master/apex-mdapi/...
0 votes
0 answers
33 views

Salesforce Apex - Metadata API fails throwing error 'Cannot set module to a nonexistent module. <SObject> does not exist.'

I have created a custom metdata type with 2 custom fields (object__c and field__c). The purpose of my apex code is to create a custom metadata record with object name and/or field names. Even though ...
  • 3
0 votes
1 answer
102 views

Bulk Importing State and Country Global Picklist Value

Is there a way to mass upload a list of Country’s and States into the Country and State Territory Picklist section of setup in Salesforce? Looks like its been an idea for a while and looking at the ...
  • 119
0 votes
0 answers
51 views

Why can't I deploy translation for a metadata owned by a managed package?

I retrieved a translation metadata via the Metadata API with the following package.xml: <?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/...
0 votes
0 answers
49 views

Create Named Credential from metadataservice class throwing "an AWS access key ID is required for the specified authentication"

I am using metadata service class to create namedcredential via apex code and setting below values credential.fullName = 'AWS_CONNECT_TEST'; credential.label = 'AWS CONNECT TESTAB1'; credential....
  • 65
1 vote
0 answers
51 views

Using Apex to determine Connected App

I want to share an Apex class with two Connected Apps that will be housed in different Managed Packages: ProdApp and TestApp. Is there a way to programmatically determine which of the two Connected ...
0 votes
1 answer
35 views

How to query Salesforce Synonyms

Does anyone know how to query Synonym information? Setup > Quick Find box > enter Synonyms > Synonyms The documentation online is very sparse and does not provide any information on how to ...
1 vote
0 answers
66 views

Experience Bundle Metadata - how to retrieve an API Name of the Page?

I created a new Page in my Customer Experience site, called 'Test Page'. Its properties are shown in the following image: I would like to retrieve its API Name, in this case it's Test_Page__c. I ...
1 vote
1 answer
91 views

Custom lead conversion process with custom lead mapping

I want to create the custom lead conversion process where user can map the standard fields as well with the objects(Account, Contact, Opportunity) fields. In short I want to override the standard lead ...
2 votes
1 answer
94 views

Metadata Retrieve missing files

I am having an issue when retrieving a package using the Metadata API. I am trying to retrieve a package that has a flow in it. Here is a sample request: <soapenv:Envelope xmlns:soapenv="...
0 votes
1 answer
47 views

Where can I set in Salesforce the PlatformEventSubscriberConfig fields that are accessible (or not) to my Profiles?

It's my first time dealing with PlatformEventSubscriberConfig in our project (and I'm very new to Salesforce, still a 6-month newbie). We have 2 orgs and I noticed that when I query in UAT (Developer ...
0 votes
1 answer
115 views

Query for all Lookup fields to a specific Object

I need to find all lookup relationships to the Contact object across all of our Objects in Salesforce. So any object which has a lookup field to the Contact object including the standard fields (e.g. ...
  • 167
1 vote
2 answers
51 views

Can translation languages be activated/deactivated with the Metadata API?

For existing translation languages, some of them can have an inactive status as below: There is a Translations Metadata Type that doesn't have any Status or IsActive tag. At first deployment, any new ...
0 votes
0 answers
43 views

Unable to add CustomField to CustomObject Python API Simple Salesforce

When trying to UPDATE CustomObject with newly added custom field, I get this error message: TestCustomObject__c.AccountNumber_NEW__c: (INVALID_CROSS_REFERENCE_KEY, In field: fullName - no CustomField ...
  • 11
0 votes
1 answer
107 views

Can you delete Metadata from the API [closed]

I would like to know if I deployed metadata to a customer's instance via the metadata api, is it possible to create a script to delete said metadata out via the metadata api? I see a couple of posts ...
  • 119
0 votes
1 answer
73 views

Is it possible to create a field on a system object?

I need to create a field on DatedConversionRate object (advanced currency management object). The object is missing in the Object Manager, so I can not create the field via the UI. I am not able to ...
  • 55
1 vote
0 answers
98 views

Different Case's Created Date fieldApiName for Case's list view

I have custom logic to create listview with filters for any object in SF using metadata api. I noticed when I try to upadate All Opened Cases listview and add filter logic CreatedDate equals TODAY (...
0 votes
0 answers
68 views

Unable to retrieve Flow meatada with Formula Entry Condition

I have a Record triggered flow that is after create or update with API Version is 56.0. The flow is using the new Entry Condition of "Formula Evaluates to True". The file structure is in ...
  • 494
5 votes
1 answer
201 views

Failure to deploy code with External Credential

Were you able to deploy External Credential, or have you left it out as a manual step? We currently try to deploy a package with a Named Credential, using External Credential (new on Winter'23) with ...
0 votes
2 answers
201 views

Content Detail pages host Salesforce CMS content. If you want content on the B2B_Pharma_Store1/views/newsDetail.json, add this site as salesforce CMS

When deploying a digital experience via Metadata API I am receiving the following error: Content Detail pages host Salesforce CMS content. If you want content on the B2B_Pharma_Store1/views/newsDetail....
  • 1
-1 votes
1 answer
55 views

Delete and create custom field of an object via APEX

Is it possible to delete and create custom field of an object via APEX ? If yes then how?
0 votes
0 answers
53 views

SFDX meta data deployment issue for existing apex component update

We have an issue to deploy apex components updates with new or removed attributes, or controller class variable updates. When deploying the component together with related apex pages, sfdx force:...
0 votes
0 answers
124 views

Retrieve Parent record field values using Query API

I am trying to query Salesforce opportunities from another Salesforce org using the Query API I am setting the following query in the endpoint method request.setEndpoint('callout:'+namedCredential+'/...
  • 1,175
1 vote
1 answer
66 views

How to fetch "Customize Application permission" values for a user through an API call

I'm trying to find out how to (programmatically) determine if a user has the required permissions to for certain actions. Specifically, according to this page https://help.salesforce.com/s/articleView?...
  • 111
0 votes
1 answer
73 views

Platform Events in Managed Package [duplicate]

I want to add a platform event to my managed package, however since platform events are not supported in professional edition, it will break the installation of the package in professional edition. Is ...
  • 941
1 vote
0 answers
106 views

Set Home Flexipage as Org Default via the API

I have a new Lightning Home Page that I would like to push out to my customers and set it automatically as the Org Default via the metadata API. Salesforce documentation here makes it sound like its a ...
  • 119
0 votes
0 answers
171 views

How to assign multiple values to the filter value in list views through apex code

I've an requirement where I'm adding a new filter for the list views through apex code since we have 1000+ list views in prod. Below I've added a new filter where lead status not equal to closed and ...
1 vote
0 answers
943 views

Deploying Page Layout Assignments

Edit: This issue turned out to be my mistake. I was deploying to one org and checking Setup in another org. However, since there's not any other questions specifically about deploying only page ...
  • 2,075
0 votes
1 answer
64 views

How to retrieve CodeSet.CodeSetType standard value set metadata xml file?

What are names for StandardValueSet files of the CodeSet.CodeSetType and CodeSetBundle.Type picklist fields? I need to customize these picklist fields and save them to VCS to run deployments using CI/...
0 votes
0 answers
125 views

Get Name of Currently showed Page Layout - LWC

I'm currently working on building a LWC component that will generate and export word documents based on page layouts. The component is exposed on object records, and pulls the recordId,Objectype etc ...
  • 71
0 votes
0 answers
79 views

Apex Metadata API limits

Does a call to Metadata.Operations.retrieve via Apex count towards the API limit? We are dynamically getting page layout via metadata API in Apex to build a custom UI in lwc. Couldn't find any ...
  • 736
2 votes
1 answer
292 views

How can I programmatically send users through a Per User Named Credential OAuth flow without directly calling the Metadata API?

I have a named credential configured against the the Microsoft Graph API (https://graph.microsoft.com) with a Per User Identity Type, an OAuth 2.0 Authentication Protocol, and a configured ...
  • 1,160
0 votes
0 answers
67 views

Is readMetadata() the only way to retrieve complete Profile information?

Is there any way other than using the Metadata API's readMetadata() method to retrieve the complete Profile detail (ProfileFlowAccess, etc) metadata? Unlike PermissionSets, retrieve() Profile only ...
  • 156
0 votes
1 answer
578 views

Lightning Web Component Action not showing up on community page

I've been having this issue where I created a LWC to act as an action, and while it shows up fine on the record page, I'm having some issues having it show up on my Community App. At first I thought ...
0 votes
0 answers
375 views

Unable to retreive org to VSCode

I am having problem with retrieving org to my VS Code. I usually work with IntelliJ, but I need to do some quick testing on my other laptop, so I tried using VS Code. Here are steps that I did so far: ...

1
2 3 4 5
25