I have successfully been able to add a new value to the Picklist for Lead.LeadSource
using the PHP Toolkit on the MetaData API using the following:
$sfm = new SforceMetadataClient(...)
$obj = new SforceCustomObject();
$obj->currentName = 'Lead.LeadSource';
$obj->metadata = new SforceCustomField();
$obj->metadata->fullName = 'Lead.LeadSource';
$obj->metadata->type = 'Picklist';
$obj->metadata->picklist = new stdClass();
$obj->metadata->picklist->sorted = false;
$obj->metadata->picklist->picklistValues = array();
$obj->metadata->picklist->picklistValues[0] = new stdClass();
$obj->metadata->picklist->picklistValues[0]->default = false;
$obj->metadata->picklist->picklistValues[0]->fullName = 'Test Source';
$result = $sfm->update($obj);
This however doesn't filter down to any of the RecordTypes.
I've now spent several hours to rework the above code to try and get it to update the individual record types that extend Lead. I have also tried to adapt the Java code provided for RecordType Object into PHP with no success.
Is there anyway to achieve what I am trying to do?
(If you know the PHP that would be really handy too)
Thanks