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
80
votes
2answers
13k views

Has anyone, ever, successfully invoked the Metadata API from within Apex?

While researching a semi-related question posted here earlier, I dug up some interesting and conflicting information regarding whether it's even possible to use the Metadata API from within Apex. I ...
34
votes
2answers
327 views

Which kind of issues will be shown at trust.salesforce.com and which issues will be omited?

In the context of a different question, we encountered a deployment performance degradation on EU5 of between 6000% to 10000% using Metadata-API. This means that work (saving a single APEX file to the ...
34
votes
2answers
426 views

Related Objects in User.layout Metadata on Winter '14

What's going on with the layouts/User-User Layout.layout metadata file? I have scripts that snapshot all of my metadata every day. Ever since we upgraded to Winter '14, the following lines are ...
30
votes
9answers
41k views

How to debug the mysterious “duplicate value found: <unknown> duplicates value on record with id: <unknown>” error

I've just spent several hours trying to fix a deployment that was failing with the following extremely helpful error message: Error: objects/Opportunity.object(2098,13):duplicate value found: <...
22
votes
3answers
13k views

Getting Session ID in Lightning

Background I'm using Apex Wrapper Salesforce Metadata API to update some picklist values on the fly. (i.e. Every time a record is inserted/updated/deleted in Table A, I'm adding/subtracting picklist ...
22
votes
1answer
6k views

difference between metadata and tooling API

What is the difference between metadata API and tooling API? When I read the documentation, they both appear the same to me from the metadata perspective. I would like to know how I can use it for ...
21
votes
7answers
11k views

How to get a list of the managed packages (including version numbers) installed in an org?

For a continuous integration setup, I only want to install/upgrade some packages (through the new InstalledPackage mechanism) when necessary. I've looked at the Metadata WSDL (and documentation) and ...
21
votes
4answers
4k views

Hard-Delete Objects Using the Force.com Migration tool

Is there a way to hard-delete custom objects using the Force.com migration tool? When you deploy a DestructiveChanges payload, the objects are "soft-deleted" and not erased from the platform. This ...
20
votes
4answers
5k views

Ant vs other deployment tools

I am wondering if there are any use cases for using Ant specifically over all other deployment methods and tools? It seems Eclipse, changesets and packages have all the functionality you need.
20
votes
5answers
24k views

Generate complete package.xml for Org

I'm using the Force.com Migration Tool for Ant more and more. I currently have several organizations at different API versions (release previews, for example). Is there a way to generate a complete ...
18
votes
6answers
3k views

How to keep sandbox in sync with changes from other developers?

We are a team of 9 developers, working on a large project and commits are made to master branch all the time. When I needed to work on any new enhancement I used to pull everything from master branch ...
16
votes
1answer
13k views

Using Meta data api in apex

i know if u have to create a field in apex then u have to call meta data api of salesforce.i found only this link for implementation https://github.com/financialforcedev/apex-mdapi is there any other ...
16
votes
3answers
19k views

How do I get the length of a string field?

For a string field, is there a way to get the defined length of the field? For example say I allow a maximum of 10 chars, can I get that in apex? I am not asking how to get the length of a string (i....
16
votes
3answers
13k views

How to push code to production with Visual Studio Code & DX

I am using Visual Studio Code to develop new functionality. However, after completing the testing in the sandbox, I want to push the code to production. When I choose "SFDX: Deploy Code to org", it ...
15
votes
1answer
466 views

Did something change with deploy run test behavior with sandboxes in Spring '14?

Starting a few days ago my apex class compilation time suddenly ground to a halt. After going into the setup deployment monitoring I was at first delighted with the new deployment monitoring UI, then ...
14
votes
2answers
3k views

Lightning: is direct API access on the roadmap?

I'm programming developer tools and an IDE. Right now, my code is based on Visualforce and JavaScript. As described here, I would like to convert most of my API callouts form APEX to JavaScript. Also ...
14
votes
1answer
2k views

Access MetadataAPI via JavaScript

We created an 100% native Salesforce IDE as a Managed Package which is using ToolingAPI and MetadataAPI via APEX. This works fine. But there is one thing which really bothers people after the ...
13
votes
2answers
15k views

How to retrieve layouts of customs objects belonging to a managed package?

I am trying to retrieve the layouts of all(standard + custom) objects from a test Enterprise org using package.xml manifest files. There are some customs objects that I have created on this org. ...
13
votes
1answer
9k views

Deleting custom object via destructiveChanges.xml and Metadata API deploy()

I've created a custom object in a developer edition org with the sole intention of deleting it via the Metadata API as per Deleting Components from an Organization. To do this I created the following ...
13
votes
1answer
872 views

Metadata API deployments are failing in Spring '19

For some time now (several years) I've been deploying changes to Apex classes using the Metadata API deploy web method with an associated zip file containing the metadata and package.xml file. This ...
13
votes
1answer
1k views

Possible to update NamedCredential from Apex?

Question Is it possible to create or update a NamedCredential from within Apex? Investigation I looked into available options, and it seems the SOAP API only supports the describeSObjects(), query()...
13
votes
1answer
325 views

How do I determine which sObjects and fields are valid to use with an Outbound Message?

We are creating OutboundMessages programmatically using the SOAP Metadata API. We've discovered that not all returned sObjects are supported and some supported sObjects have fields which are not ...
12
votes
2answers
297 views

Initiate an oAuth flow via an Auth Provider

I use the Metadata API and the Apex wrapper to create an AuthProvider and NamedCredential after the installation of my managed package app. MetadataService.NamedCredential cred = new MetadataService....
12
votes
1answer
429 views

Will LightningComponentBundle and LightningComponentResource mapped into the database like AuraDefinitionBundle and AuraDefinition

I'm checking this on a Spring'19 v45 Sandbox in Execute Anonymous: [ select Id from AuraDefinitionBundle ] // ==> works fine! [ select Id from AuraDefinition ] // ==> flawless!...
12
votes
3answers
382 views

Metadata+ToolingAPI access on CS14 (and other pods) extremly slow & No Support?

We are working on CS14. Starting last Friday we are suffering form a extreme performance loss on CS14. Loading and Saving Metadata via Tooling/Metadata-API is very slow. Operations which usually ...
11
votes
1answer
6k views

Dynamically set remote site Setting in Apex

I have created a managed package that uses tooling API for updating class, trigger etc. Everything runs fine with all sorts of testing. I have created this package in my Developer org. I had to set ...
11
votes
2answers
2k views

How is Permission Set Metadata Deployment changing in Summer '17 (API 40.0)?

Salesforce recently sent out an email entitled ATTENTION: Update to Permission Set Metadata Deployment in API 40.0 with Summer ‘17 Email contents: Product & Service Notification As an ...
11
votes
3answers
7k views

How to Search Workflow Rules or Validation Rules etc in Apex i.e. Metadata Search via Apex?

Recently I'm working on building something for developers/administrators - a handy 100% force.com app allowing to search metadata. Currently this app allows you to quickly search (from sidebar) custom ...
11
votes
1answer
757 views

Strategies to deal with slow metadata api performance

I'm slightly concerned that this question is might not fit here but, as you will read, I have a lot of time on my hands... Around release-time, Salesforce performance tends to plummet and right (in ...
11
votes
1answer
117 views

Programmatically detecting unpackaged metadata in org that depends on my package

My managed package is extensively customized and extended by some customers in their org. For our packaged objects they e.g. add Triggers + Custom Apex code Fields Validation Rules Workflows Process ...
11
votes
1answer
992 views

Metadata converted from Metadata API won't push to scratch org with SFDX

I'm trying to convert one of my company's apps to Salesforce DX for continued development, but pushing the source retrieved from the current Developer Edition org isn't working. I've created a new ...
10
votes
2answers
6k views

Parent entity failed to deploy

I'm trying to use the metadata api to do a destructive change call on all non-packaged components in my sandbox. However, I keep receiving the following error: layouts/SocialPost-Social Post ...
10
votes
2answers
294 views

Is there an API that returns consolidated metadata including layouts?

I believe I saw some information about a recent REST API that provided consolidated metadata including layout information. (For use by e.g. a mobile app that wants to base its screens on the metadata.)...
10
votes
2answers
2k views

Connected apps available via Metadata API?

When developing apps for the AppExchange, we use a development workflow in which each developer has their own DE org, but commits to a common source code repository (git in this case). We then use a ...
10
votes
3answers
5k views

Metadata API Custom Field Permissions (how to automate this process)

We are using the Metadata API to add Custom Fields to the Account object in Salesforce. We are able to create the custom fields, but then the Salesforce user has to manually login to their account ...
10
votes
1answer
3k views

Force.com Migration Tool - Standard Quickactions not found during deployment

I am trying to deploy between sandboxes using the Force.com migration tool but keep getting build failures because the standard Case quickactions (Case.Email, Case.ChangeStatus, etc) used on certain ...
10
votes
1answer
290 views

Custom metadata retrieval fails in Winter '20

In Winter '20 sandbox, retrieval for custom metadata using wildcard is failing: package.xml <types> <members>*</​members> <name>CustomMetadata</name> </types&...
10
votes
1answer
527 views

Managing presence of <objectPermission> tags in profiles

When retrieving profiles for custom objects in a project.xml manifest, the returned profiles do not contain the objectPermissions object for objects that they do not have access to (ie no CRUD ...
9
votes
5answers
2k views

Retrieve unpackaged and installed managed package components in a zip file

I actually know how to retrieve zip for unpackaged components through RetrieveRequest object. I now want to retrieve unpackaged components as well as all installed packaged components(Installed ...
9
votes
3answers
12k views

Full List of All Accessible Types Through Metadata Api

I am looking for some official Salesforce documentation on a list of all available types in the metadata API. If I am using a package.xml file that looks like: <?xml version="1.0" encoding="UTF-8"?...
9
votes
4answers
6k views

Are profile and permission set metadata files getting all project objectPermissions?

I have a project in development. There about 45 new SObjects to the org but there is also a couple of new profiles for the org. The permissions on several existing SObjects have been specifically ...
9
votes
1answer
587 views

Does enabling Dev Hub disable anything else? Can I turn off Dev Hub?

I am looking at that Dev Hub feature and how well scratch org development mirrors what I do currently in Sandboxes and metadata API deployments. It'd be nice to pilot the feature, but if it is ...
9
votes
1answer
1k views

How to write Address.settings in order to implement Country Picklists via Metadata API (eclipse)?

In order to implement Country Picklists on standard address fields I'm following the documentation here: https://help.salesforce.com/HTViewHelpDoc?id=admin_state_country_picklists_overview.htm&...
9
votes
1answer
2k views

Is it possible to delete a record type through Metadata API?

I'm deploying a destructiveChanges.xml file via Force.com Migration Tool to delete some listViews, Custom Fields, and Groups. I determined we also can remove some record types from Cases. I received ...
9
votes
2answers
2k views

Can you deploy “Tab Hidden” to a Custom Object on a Profile using metadata API? (tabVisibilities)

I have a custom object called MyCustomObject.object and a custom profile called MyCustomProfile.profile Currently the tab visibility of MyCustomObject is set to "Default On" for MyCustomProfile. <...
9
votes
1answer
5k views

REST API: How to update active values for picklist?

I need to update the Picklist values for a custom field on a custom object. I have already populated the Available Values via the Enterprise and Metadata Java APIs, but now I need to move the newly ...
8
votes
2answers
1k views

Metadata API error while reading Picklist: Web service callout failed: Unable to find apex schema info

I am trying to read a custom dependent picklist field and update it's field-dependencies. I have followed the common resources found online and getting the below error: FATAL_ERROR System....
8
votes
2answers
622 views

Why is this Apex Class dependent on a bunch of completed Apex Jobs?

I've got a Batch Apex Class like so. (It happens to use the Dan Appleman decoupler pattern, augmented for batch. Thanks Dan!) public with sharing class Dispatcher implements Database.Batchable<...
8
votes
2answers
426 views

Are full backups & recoveries not possible?

While it appears that Salesforce supports backups of data & configs, it also appears that a complete backup is not possible. Have I misunderstood the meaning of this page? For example, does this ...
8
votes
1answer
2k views

Is there a Javascript Wrapper Salesforce Metadata API?

I'm using Andrew Fawcett's legendary Apex Wrapper Salesforce Metadata API in several projects. It perfectly works and provides a new dimension of APEX programming. Now there are situations where it ...

1
2 3 4 5
20