Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
16 votes
Accepted

How to find classes that implement an interface dynamically?

Edit: We can now query the ApexTypeImplementator table to find all public and global classes that implement a given interface locally, as well as global classes in managed packages that implement a ...
sfdcfox's user avatar
  • 494k
16 votes
Accepted

Query the created date of a custom field?

The FieldDefinition table doesn't have a CreatedDate field, but CustomField does (but it's not in the documentation). It seems to me that you'll need to perform two queries and then match up the ...
sfdcfox's user avatar
  • 494k
11 votes
Accepted

Is there a *public-facing* list of GACK codes?

I work for Salesforce on the Apex product team, but this is mostly personal opinion and not an official stance. is there a GACK ID to Metadata Type list for issues around the Metadata/Tooling/Bulk ...
ca_peterson's user avatar
9 votes

How can I activate a Lightning Page via metadata?

[This] can be achieved by using the following in an applications/AppName.app metadata file: <profileActionOverrides> <actionName>View</actionName> <content>PageName&...
shannon's user avatar
  • 337
8 votes
Accepted

How do I update Custom Label's value using apex? Which one would be a better option metadata api or tooling api? Please provide example

You can use this MetadataService class and follow this example: public static void updateField() { MetadataService.MetadataPort service = createService(); MetadataService.CustomField ...
Renato Oliveira's user avatar
8 votes
Accepted

Is it possible to use the Tooling API to update field level security on Profiles and PermissionSets?

The objects you're looking for are UserEntityAccess and UserFieldAccess, for object security and field security, respectively. Unfortunately, it appears that these tables are read-only, so you're ...
sfdcfox's user avatar
  • 494k
8 votes
Accepted

How can I know via API how many fields are allowed to create in custom object

yes, use EntityLimit of Tooling API Represents the limits for an object as displayed in the Setup UI. you need to look CustomFields type and get Remaining field value. Example, how to get all ...
Oleksandr Berehovskyi's user avatar
8 votes

Is there a *public-facing* list of GACK codes?

The GACK ID values are derived heuristically, and are only meant for grouping crashes with the same root cause together, in order to define the frequency of the crash. It is up to a human to read the ...
sfdcfox's user avatar
  • 494k
7 votes
Accepted

Anyone else having issues with deployment to sandbox stuck in pending for 5-60 minutes

So the response from R&D via Support was: As discussed on call, I went back to RnD to confirm your request. They have confirmed that It is the nature of multi tenet architecture of ...
Eric's user avatar
  • 54.2k
7 votes
Accepted

Salesforce Packaging Bug with Lightning Components? (Warning: very strange!)

I was able to replicate this issue in two packages, so have raised it with support, and they are currently researching it (they were able to re-create it) One thing I noticed as a workaround - I had ...
BritishBoyinDC's user avatar
7 votes
Accepted

Create/Update Global Value Set using Tooling API

As mentioned by Daniel, you can develop code to create/update GlobalValueSet. By using tooling api, we will need to make http request to endpoint (/services/data/v41.0/tooling/sobjects/GlobalValueSet)...
Ayub's user avatar
  • 3,523
6 votes
Accepted

Symbol Table from Apex Class

You can't use Tooling API SOQL queries directly in Apex. Currently they would need to be passed out the the SOAP or REST API's. The challenge with the SOAP version of the Tooling API will be creating ...
Daniel Ballinger's user avatar
6 votes

Describe not returning Inactive picklist values via API

I believe this to be a current limitation of the API for picklist fields. I tried as well to get field metadata for a deactivated picklist value. It didn't come back, even though there is an active ...
Daniel Ballinger's user avatar
6 votes
Accepted

Object type 'SandboxInfo' is not supported

The API is applicable only for PROD instance from where different sandboxes are spun.Hence it won't return any result for sandbox
Mohith Shrivastava's user avatar
6 votes
Accepted

Tooling API calls from Apex requires user to set up Remote Site Settings?

If I wanted to distribute something using this through the AppExchange, should I have to include instructions to add the endpoint in the remote site settings? Or is there a way to automate this ...
Adrian Larson's user avatar
  • 150k
6 votes
Accepted

How to send a PATCH HTTP Callout from Apex to Salesforce Tooling REST API

Use ?_HttpMethod=PATCH in the request URL. public static HttpResponse makeHttpCallout(String url, String method, String body, Map<String,String> headers){ HttpRequest request = new ...
Robs's user avatar
  • 9,356
6 votes
Accepted

Is it possible to discover a sandbox version with a API request to a sandbox?

Making a call to the {your sandbox domain}/services/data REST API will return a JSON response with all the available API versions. Here is the JSON response: [..., { "label" : "Winter '19", "url" ...
Bryan Anderson's user avatar
6 votes

Calling Tooling API via ApexClass

You are sending the literal string EncodingUtil.urlEncode() instead of calling the method to build a string. You want: String body = restGet( baseURL + '/services/data/v47.0/tooling/query?'+ 'q=...
Andy Ray's user avatar
  • 1,468
5 votes
Accepted

ToolingAPI bug? Dev Console only: No such column 'PoNumber' on entity 'Order'

This behavior is most commonly observed when trying to query on a field you do not have read access to via Field Level Security. Navigate to that field in the Setup menu, then click the Set Field-...
Adrian Larson's user avatar
  • 150k
5 votes
Accepted

How to get Custom Object Metadata CreatedBy

As of API Version 33.0, you can query CreatedBy information via the Tooling API. Queries including this field and using API Version 32.0 or below will fail. SELECT CreatedById, CreatedBy.Name, ...
Adrian Larson's user avatar
  • 150k
5 votes

Tooling API - Enable/Disable Parallel Test Execution?

Perhaps it would help you to look at the Force.com Tooling API documentation, specifically on REST Resources. There are some URIs listed that look useful to you: /runTestsSynchronous/ /...
Adrian Larson's user avatar
  • 150k
5 votes
Accepted

Tooling API - Enable/Disable Parallel Test Execution?

Specifically to your question on "Disable Parallel Apex Testing". No, I don't believe there is currently an official method in the Tooling API that exposes this setting. That said, with ...
Daniel Ballinger's user avatar
5 votes
Accepted

Update an existing trigger with tooling API

Tooling API support update also. It is regardless of Component type. All you need to do is create "MetdataContainer" using Tooling API. Create Metadata Container Get the Trigger Id Change the body ...
Ashwani's user avatar
  • 22.6k
5 votes

Tooling API from Visualforce - OK in managed package?

The rule of thumb for the security review is no self-modifying code. That is, suppose you want to publish an app that is an IDE and creates other packages. That's going to be OK as long as the ...
Robert Sussland's user avatar
5 votes
Accepted

How to get dependent classes for a trigger?

You have not specified if you want this programmatically, so my guess is that you can get all dependencies with change sets. Create a change set, and then add your trigger on it. Click on "View/Add ...
Renato Oliveira's user avatar
5 votes
Accepted

Cannot retrieve full class list from the org using tooling API?

You will need to change your strategy as including all the class names you have already queried is causing the query string to exceed the 20,000 character query limit. The Partner API includes the ...
Keith C's user avatar
  • 136k
5 votes

create and update custom labels through ToolingAPI

We can use tooling API to create the custom label and its translation as below. The Master label is stored in External String and translation is stored in ExternalStringLocalization Request to create ...
Ayub's user avatar
  • 3,523
5 votes

Finding sharing settings OWD

There's a better way to get this from apex directly without callouts now! List<EntityDefinition> eds = [SELECT DeveloperName, ExternalSharingModel, InternalSharingModel FROM EntityDefinition]; ...
Mike Tetlow's user avatar
  • 1,571
5 votes

Tooling API in Apex - polymorphism, generic query() callout?

As you found, if you just use the direct QueryResult against the SOAP API and include anything in the fields beyond the ID you get the following response: SOQL: Select Id, Name from ApexClass ...
Daniel Ballinger's user avatar
5 votes

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

Via twitter, it sounds like they have added a work item to expose this functionality in a future release. https://twitter.com/tahir_farhan/status/1085939366764134401?s=09 Cool. Let us get to work ...
Daniel Ballinger's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible