1

I am new in the Metadata APIs of Salesforce world, but they look interesting.

I want to know if I can use Metadata APIs or basically create custom objects / fields etc. on any org without using SOAP based approach, as I want to create a generic solution.

I already saw this great library by the great Andrew Fawcett (github - afawcett)

https://github.com/financialforcedev/apex-mdapi

but wanted to know if there is a way which can help me generate a generic way to create metadata without importing anything in my org.

Thanks Ray

  • can u add some context on your use case where you want Metadata API access.. did you try to see if your work can be done with Apex + any other platform feature and then decided Metadata API is the only way ? – Vamsi Krishna Jun 3 '15 at 3:27
  • I would like to create a custom code base which when integrated with process builder or any custom page can give admins provision to create Custom Objects or fields in a custom object dynamically. I assume this is only possible using Metadata api – Kaushik Ray Jun 3 '15 at 3:36
2

I believe it would have to be a web-service based approach. As far as I know, there aren't native APEX methods for adding new custom objects or fields.

| improve this answer | |
0

You can create some sorts of metadata using the Tooling Rest Api. Custom fields are supported this way, as are record types, workflow rules, and a number of other setup types. Unfortunately, you can't yet create custom objects this way yet (custom objects support the rest method GET, with either an ID or a query, but they don't support POST), so you need to use a SOAP-based solution if you need to make entirely new objects (rather than just adding fields to existing ones).

| improve this answer | |

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.