function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kman1976Kman1976 

How can i add new picklist values to a existing custom object's picklist field using MetadaAPI

Hi I am trying to add new picklist values to an existing custom object's picklist field using MetadataAPI. Articles which i followed are below..


http://www.salesforce.com/us/developer/docs/api_meta/index.htm

http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_update.htm


If any body has implemented this pl's help me it's very importent.  I am getting errors and unable to find any good examples to do this..Thank's in advance............................

 

 

You can find my complete code in the following post

 

https://sites.secure.force.com/success/questionDetail?qId=a1X30000000ITO5EAO

ryumanryuman

Hi, Kman1976
If you add an existing selection list is below code is unnecessary.

> co CustomObject = new CustomObject();> String name = MyCustomObject;> co.setFullName(name + "_ _c");

> co.setDeploymentStatus(DeploymentStatus.Deployed);> co.setDescription("Created by the Metadata API");

> co.setEnableActivities(true);> co.setLabel(name + "Object");> co.setPluralLabel(co.getLabel() + "s");

> co.setSharingModel(SharingModel.ReadWrite);


expenseStatusField.setFullName();The argument to specify the choice list values.

ex test


expenseStatusField.setFullName();The argument to specify the object and field name.

ex MyCustomObject__c.ExpenseStatus__c


nagalakshminagalakshmi

Hi,

 

I am also having same requirement.Its very urgent for me. If you solve this.  Please help me. I did not find any example of code for this.  Please help me out.

 

Thanks,

Lakshmi

nagalakshminagalakshmi

Hi ryuman,

 

Can you please post the code in detail.

 

Thanks