2

I'm trying to access the description of existing custom objects as well as the description and validation rules of their fields using Apex. I'm already using SObjectType.getDescribe() to get other information, but the descriptions and validation rules aren't included.

What's the best way to access this information using Apex? Are there any guides I should be using? The quick start guide to access the metadata API is geared for java . Does the same process work for Apex? Is this wrapper useful or no longer relevant with the current version?

API version 40.0 (Summer '17 Preview) includes the Metadata namespace along with an Operations class to retrieve metadata. Would this allow me to access the information I'm looking for? If so, how do I form the fullName of a custom object in my org?

2

FinancialForce's Apex Metadata API Wrapper is a Metadata API written for Apex (the first link in your answer links to that wrapper API). You can only use the new Metadata namespace methods for supported Metadata API types (currently only two types, Layouts and Custom Metadata). Additional types will likely be released in the future, but the current types won't help you now.

  • Thanks for clarifying the limits of the new Metadata namespace - I'll pursue the API wrapper for now. – Scott Numamoto Jul 11 '17 at 23:46

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.