Attempting to obtain method references using the REST version of the Tooling API.

Problem /services/data/v36.0/tooling/query/q=Select+Id,Name,SymbolTable+From+ApexClass+where+Name+in+(‘MyApexClass’,’MyApexClassTwo’) Why all references = null, if I call testA() in testB() in class ‘MyApexClass’ and then tesB() in testC() in external class ‘MyApexClassTwo’? Solution As you have found, you need to use an ApexClassMember to access the full SymbolTable. The ApexClassMember’s often don’t exist for the class of interest, so you must create them. The same …

Attempting to obtain method references using the REST version of the Tooling API. Read More »

How to Choose the Initial Record from a Set of Multiple Records

I have a custom sObject which has among others the following fields: email__c (email), some_date__c (date), external_id__c (integer) and criteria__c (string). There are multiple records for this sObject that have the same value for email__c. If an email address returned in the results has multiple records we want to select the record with the most recent date. If there is …

How to Choose the Initial Record from a Set of Multiple Records Read More »

Generating an Apex Class Using the SOAP Tooling API and MetadataContainer

QESTION It’s fairly easy to create an ApexClass in the SOAP Tooling API: This immediately creates the class in your org. However, I would like to be able to utilize the MetadataContainer functionality to create classes in this manner: When I try this, I get an error as follows: Adding a line to populate the Content field …

Generating an Apex Class Using the SOAP Tooling API and MetadataContainer Read More »

Performing an UPDATE on a Custom Field Using the SOAP Tooling API

QUESTION I’m using the SOAP Tooling API to try and update a CustomField (posting to /services/Soap/T/29.0) The method signature is SaveResult[] update(sObject[] sObjects) – and CustomField extends sObject so it shouldn’t be a problem to send that down the wire. However I encounter: INVALID_TYPE: Must send a concrete entity type. Then I looked at my raw XML on the wire, I can’t say I’m surprised! …

Performing an UPDATE on a Custom Field Using the SOAP Tooling API Read More »