1

Good day!

Is there a documentation on how to perform crud operations on Salesforce Standard Objects? Can anyone point me to it?

What I need to do is to add entries on the picklist field of a Standard Object programmatically. For example, let's say I want a new option in my dropdown so I need to add an entry in a picklist field. So I was thinking if there is an API documentation to perform CRUD operations for Salesforce Standard Objects. Particularly showing what URL should be used and what payload should be passed.

I've bumped into Metadata API, Tooling API, and the SObject Describe API but it seems it is not what I am looking for. Or am I just missing something? Need help! Thanks in advance!

P.S. I am a newbie with salesforce.

2
  • Hi Oneb. Welcome! Could you describe your problem a bit more? What field are you trying to update on which object? When you say "add entries on the picklist" do you mean update the picklist so future views of the drop-down include those values. If so, that is a Metadata issue. If you are talking about adding records with new values to a picklist field then that is a CRUD issue but it has a configuration wrinkle. A picklist can be set to either allow new values or only permit pre-define values. With a bit more information about your case we can offer suggestions.
    – Rob Davis
    Aug 16 '19 at 2:59
  • Hi @RobDavis. Thanks for the help. I did edit my question but I'll answer in here as well. I want another entry in the picklist field to appear as a new option if ever I create a new instance of the object where the picklist field is under. Am I making sense?
    – Oneb
    Aug 16 '19 at 3:12
3

You can't perform CRUD operations on metadata in the same way you can with standard sObjects. They're part of the configuration of the system, and you've got to jump through some more hoops in order to mutate them because of their wide-ranging effects on the operation of your CRM.

The API that you'll need to work with to make these updates is the Metadata API. Specifically, you'll need to create and deploy a StandardValueSet entity. The names of the Standard Value Sets corresponding to specific picklists in the standard data model is given here.

You cannot make this change in standard Apex. If you're trying to work in Apex, you'd have to use something like the apex-mdapi library. Any user under whose context the operation is run must have the appropriate permissions to access the Metadata API.

If you're working outside Salesforce, your application will make calls to the SOAP or the newer REST resources of the Metadata API to deploy ZIPped XML source code, or make CRUD-style calls like createMetadata().

0

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.