0

I have an app that creates apex classes for some purposes, right now we are using Tooling Api, but some objects are not entirely accessible with it (e.g. developerName in RecordType Object). So my question is is there a way to overcome this limitation (e.g. REST API or SOAP API etc.)

4
  • What do you mean, exactly? You want to use one single API to create record types, apex classes, and update records, or something?
    – sfdcfox
    May 13 at 12:03
  • I wish to create/delete apex classes to/from org
    – DavidS
    May 13 at 12:18
  • For what kind of org? Production? Sandbox? Developer Edition?
    – sfdcfox
    May 13 at 12:19
  • Sandbox........
    – DavidS
    May 13 at 12:20
2

Generally speaking, for non-production orgs, you have several options available.

Tooling

Create

POST /services/data/vXX.X/tooling/sobjects/ApexClass

Update

PATCH /services/data/vXX.X/tooling/sobjects/ApexClass/:Id
PATCH /services/data/vXX.X/tooling/sobjects/ApexClass/Name/:Name

Delete

DELETE /services/data/vXX.X/tooling/sobjects/ApexClass/:Id
DELETE /services/data/vXX.X/tooling/sobjects/ApexClass/Name/:Name

Metadata Container

For deploying multiple ApexClass objects (and other code) in a single deployment. See the documentation for this, it is relatively complex.

REST

Create

POST /services/data/vXX.X/sobjects/ApexClass

Update

PATCH /services/data/vXX.X/sobjects/ApexClass/:Id
PATCH /services/data/vXX.X/sobjects/ApexClass/Name/:Name

Delete

DELETE /services/data/vXX.X/sobjects/ApexClass/:Id
DELETE /services/data/vXX.X/sobjects/ApexClass/Name/:Name

SOAP

Create

create(ApexClass)

Delete

delete(ApexClass)

Metadata API

Create/Update

deployMetadata(ApexClass)

Delete

deleteMetadata(ApexClass)
1
  • If i use REST for example must i configurate my app as a "connected app"?
    – DavidS
    May 13 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.