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
Abhilash Mishra 13Abhilash Mishra 13 

How to Add and Replace values of picklist field through meta data api

I am Using php tooklit for intergration.
Is there any way I can replace , delete or add new picklist value to an Existing Picklist value.

This is very important for me. 
Abhilash Mishra
Tejas KardileTejas Kardile

Please refer below salesforce article which will help you in adding picklist value through api

Tejas KardileTejas Kardile
Please refer this article as well.
Abhilash Mishra 13Abhilash Mishra 13
Hi Tejas,
I Tried php toolkit sample code  of creating a custom object and got this Error

Function ("create") is not a valid method for this service

Here is the code.
// SOAP_CLIENT_BASEDIR - folder that contains the PHP Toolkit and your WSDL
// $USERNAME - variable that contains your username (must be in the form of an email)
// $PASSWORD - variable that contains your password

//require_once (');
require_once ('');
require_once ('');
//require_once ('');

//$mySforceConnection = new SforcePartnerClient();
$mySforceConnection = new SforceEnterpriseClient();
//$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml');
$mySoapClient = $mySforceConnection->createConnection('wsdl.jsp.xml');
$loginResult = $mySforceConnection->login($usename, $password);
echo "<pre>";
echo "</pre>";
$myMetadataConnection = new SforceMetadataClient('metadata.xml', $loginResult, $mySforceConnection);
echo "<pre>";
echo "</pre>";
$customObject = new SforceCustomObject();
  $customObject->fullName = 'CustomObjFromPHP__c';
  $customObject->deploymentStatus = DEPLOYMENT_STATUS_DEPLOYED;

  $customObject->setDescription("A description");
  $customObject->setLabel("My Custom Obj from PHP");
  $customField = new SforceCustomField();
  $customField->setDescription('Description of New Field');
  $customField->setLabel('My Custom Field Label');

  $customObject->nameField = $customField;

  $customObject->pluralLabel = 'My Custom Objs from PHP';
  $customObject->sharingModel = SHARING_MODEL_READWRITE;


} catch (Exception $e) {
  echo $myMetadataConnection->getLastRequest();
  echo $e->faultstring;