• Apex Learner
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 23
    Replies

hi i have woring on METADATA Api and soap ui

 

and i have successfully create soap envelope to add new picklist value in picklist field

via

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
   <soapenv:Header>
      <met:CallOptions>
         <met:client>---</met:client>
      </met:CallOptions>
      <met:SessionHeader>
         <met:sessionId>---</met:sessionId>
      </met:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <update xmlns="http://soap.sforce.com/2006/04/metadata">
     <!--Zero or more repetitions:-->
      <UpdateMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="customfield">
		    <currentName>lead.number__c</currentName>
		                
		      <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
		      <!--Optional:-->
		       <fullName>lead.number__c</fullName>
		       <label>number</label>
		    		<picklist>
		              <picklistValues>
		         			<fullName>new</fullName>
		              </picklistValues>
		         		 <sorted>false</sorted>
		  		</picklist>
		         <type>Picklist</type>
		    </metadata>
         </UpdateMetadata>
       </update>
   </soapenv:Body>
</soapenv:Envelope>

 Now issues I am facing , is

Is there any way to update / edit any particular picklist value ???

 

e.g , Object : Lead , field : number__c, type : picklist , picklist values : new , old 

 

any way i can edit "new " to "new_value" via meta data API .

 

Thanks to soap and metadata api developers in advance 

 

hi guys i have woring on METADATA Api 

 

and i have successfully create soap envelope to add new picklist value in picklist field

via

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
   <soapenv:Header>
      <met:CallOptions>
         <met:client>---</met:client>
      </met:CallOptions>
      <met:SessionHeader>
         <met:sessionId>---</met:sessionId>
      </met:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <update xmlns="http://soap.sforce.com/2006/04/metadata">
     <!--Zero or more repetitions:-->
      <UpdateMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="customfield">
		    <currentName>lead.number__c</currentName>
		                
		      <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
		      <!--Optional:-->
		       <fullName>lead.number__c</fullName>
		       <label>number</label>
		    		<picklist>
		              <picklistValues>
		         			<fullName>new</fullName>
		              </picklistValues>
		         		 <sorted>false</sorted>
		  		</picklist>
		         <type>Picklist</type>
		    </metadata>
         </UpdateMetadata>
       </update>
   </soapenv:Body>
</soapenv:Envelope>

 Now issues I am facing , is

Is there any way to update / edit any particular picklist value ???

 

e.g , Object : Lead , field : number__c, type : picklist , picklist values : new , old 

 

any way i can edit "new " to "new_value" via meta data API .

 

Thanks to soap and metadata api developers in advance 

 

hi i have woring on METADATA Api 

 

and i have successfully create soap envelope to add new picklist value in picklist field

via

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
   <soapenv:Header>
      <met:CallOptions>
         <met:client>---</met:client>
      </met:CallOptions>
      <met:SessionHeader>
         <met:sessionId>---</met:sessionId>
      </met:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <update xmlns="http://soap.sforce.com/2006/04/metadata">
     <!--Zero or more repetitions:-->
      <UpdateMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="customfield">
		    <currentName>lead.number__c</currentName>
		                
		      <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
		      <!--Optional:-->
		       <fullName>lead.number__c</fullName>
		       <label>number</label>
		    		<picklist>
		              <picklistValues>
		         			<fullName>new</fullName>
		              </picklistValues>
		         		 <sorted>false</sorted>
		  		</picklist>
		         <type>Picklist</type>
		    </metadata>
         </UpdateMetadata>
       </update>
   </soapenv:Body>
</soapenv:Envelope>

 Now issues I am facing , is

Is there any way to update / edit any particular picklist value ???

 

e.g , Object : Lead , field : number__c, type : picklist , picklist values : new , old 

 

any way i can edit "new " to "new_value" via meta data API .

 

Thanks to soap and metadata api developers in advance 

 

hi i have been woring on METADATA Api 

 

and i have successfully create soap envelope to add new picklist value in picklist field

via

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
   <soapenv:Header>
      <met:CallOptions>
         <met:client>---</met:client>
      </met:CallOptions>
      <met:SessionHeader>
         <met:sessionId>---</met:sessionId>
      </met:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <update xmlns="http://soap.sforce.com/2006/04/metadata">
     <!--Zero or more repetitions:-->
      <UpdateMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="customfield">
		    <currentName>lead.number__c</currentName>
		                
		      <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
		      <!--Optional:-->
		       <fullName>lead.number__c</fullName>
		       <label>number</label>
		    		<picklist>
		              <picklistValues>
		         			<fullName>new</fullName>
		              </picklistValues>
		         		 <sorted>false</sorted>
		  		</picklist>
		         <type>Picklist</type>
		    </metadata>
         </UpdateMetadata>
       </update>
   </soapenv:Body>
</soapenv:Envelope>

 Now issues I am facing , is

Is there any way to update / edit any particular picklist value ???

 

e.g , Object : Lead , field : number__c, type : picklist , picklist values : new , old 

 

any way i can edit "new " to "new_value" via meta data API .

 

Thanks to soap and metadata api developers in advance 

hi i have woring on METADATA Api 

 

and i have successfully create soap envelope to add new picklist value in picklist field

via

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
   <soapenv:Header>
      <met:CallOptions>
         <met:client>---</met:client>
      </met:CallOptions>
      <met:SessionHeader>
         <met:sessionId>---</met:sessionId>
      </met:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <update xmlns="http://soap.sforce.com/2006/04/metadata">
     <!--Zero or more repetitions:-->
      <UpdateMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="customfield">
		    <currentName>lead.number__c</currentName>
		                
		      <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
		      <!--Optional:-->
		       <fullName>lead.number__c</fullName>
		       <label>number</label>
		    		<picklist>
		              <picklistValues>
		         			<fullName>new</fullName>
		              </picklistValues>
		         		 <sorted>false</sorted>
		  		</picklist>
		         <type>Picklist</type>
		    </metadata>
         </UpdateMetadata>
       </update>
   </soapenv:Body>
</soapenv:Envelope>

 Now issues I am facing , is

Is there any way to update / edit any particular picklist value ???

 

e.g , Object : Lead , field : number__c, type : picklist , picklist values : new , old 

 

any way i can edit "new " to "new_value" via meta data API .

 

Thanks to soap and metadata api developers in advance 

 

 

hi guys i have woring on METADATA Api 

 

and i have successfully create soap envelope to add new picklist value in picklist field

via

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
   <soapenv:Header>
      <met:CallOptions>
         <met:client>---</met:client>
      </met:CallOptions>
      <met:SessionHeader>
         <met:sessionId>---</met:sessionId>
      </met:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <update xmlns="http://soap.sforce.com/2006/04/metadata">
     <!--Zero or more repetitions:-->
      <UpdateMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="customfield">
		    <currentName>lead.number__c</currentName>
		                
		      <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
		      <!--Optional:-->
		       <fullName>lead.number__c</fullName>
		       <label>number</label>
		    		<picklist>
		              <picklistValues>
		         			<fullName>new</fullName>
		              </picklistValues>
		         		 <sorted>false</sorted>
		  		</picklist>
		         <type>Picklist</type>
		    </metadata>
         </UpdateMetadata>
       </update>
   </soapenv:Body>
</soapenv:Envelope>

 Now issues I am facing , is

Is there any way to update / edit any particular picklist value ???

 

e.g , Object : Lead , field : number__c, type : picklist , picklist values : new , old 

 

any way i can edit "new " to "new_value" via meta data API .

 

Thanks to soap and metadata api developers in advance 

 

Hi,

In our system we have few picklist like Industry, JobTitle, Country, No Of Employees. I was told by SF that I need to use the Metadata API to retrieve this list. I am able to set the Metadata service and SF connection but what object do I need to query in order to get the list.

Any help is appreciated.

 

Goutam

  • May 14, 2012
  • Like
  • 0

Is there a option to use Metadata API within Salesforce? If yes, Please give some documentation or relevant code.

 

Thanks.

Is it possible to develop an App Exchange application which is based on Metadata API.

Is Metadata Api xml organisation specific?

 

Please help.

I have to work in Metadata API to customize my salesforce org through Apex.

 

I have generated WSDL for Metadata API as well as Enterprise

but when I am generating apex code for these WSDL it is showing errors to both the files

1. Enterprise WSDL - Apex Generation FailedUnsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType

2. MetaData API- "Apex Generation Failed Class name 'Metadata' already in use. Please edit WSDL to remove repeated names"  

 

For Enterprise error changing anyType to string couldn't solve my error.

 

Please assist me if any one have any idea to get rid of this issue.

 

Thanks in advance.

 

Regards,

Tushar Seth

Is it possible to add picklist values (the metadata) using apex and a VF page?

 

I have a VF page that displays the lead source picklist values from the contact object on a VF page:

 

public List<SelectOption> getLeadSourceNames()
	{
  		List<SelectOption> options = new List<SelectOption>();
        
   		Schema.DescribeFieldResult fieldResult = Contact.LeadSource.getDescribe();
   		
   		List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        
   		for( Schema.PicklistEntry f : ple)
   		{
      		options.add(new SelectOption(f.getLabel(), f.getValue()));
   		}       
   		return options;
	}

 

On my VF page, I display the selectList and if the user select 'Other' it will open a text field where they can enter a new value and save.  It saves the value to the record, but doesn't add the new value to the actual picklist value metadata.  Is there a ay to do this?

 

Here is my VF page:

 

<apex:page standardController="Contact" extensions="DynamicPicklist" sidebar="false" >
	<apex:form >
		<apex:sectionHeader title="Dynamic Picklist" subtitle="Reusable code"/>
		<apex:pageblock >
			<apex:pageBlockSection title="Dynamic picklist" columns="1">      
				<apex:pageblocksectionItem >          
					<apex:outputlabel value="Lead Source" for="values" />          
					<apex:selectList value="{!leadSource}" size="1" id="values">              
						<apex:actionSupport event="onchange" reRender="newvalue" />              
						<apex:selectOptions value="{!leadSourceNames}"/>          
					</apex:selectList>      
				</apex:pageblocksectionItem>                                                  
				<apex:outputpanel id="newvalue">             
					<apex:outputpanel rendered="{!leadSource == 'Other'}">             
						<div style="position:relative;left:75px;">                               
							<apex:outputlabel value="New value" for="newval" />                  
							<apex:inputText value="{!newpicklistvalue}" id="newval"/>                  
							<apex:commandbutton action="{!saverec}" value="Add!"/>             
						</div>             
					</apex:outputpanel>          
				</apex:outputpanel>               
			</apex:pageblocksection>
		</apex:pageblock>
	</apex:form>
</apex:page>

 

Here is the saverec method:

 

public void saverec(){   
	con.LeadSource = newpicklistvalue;
	update con; 	
}

 

I would like to have the ability to add new picklist values from the VF page.  Is it possible using the metadata API?  If so, how?  I can't find any sample code that explains how to accomplish this.

 

Thanks for any help.

Hi All,

 

I am here below copying a paragraph from the Metadata API user guide that it is confusing me and I wonder if someone could shed some light.

 

You can modify metadata in test organizations on Developer Edition or sandbox, and then deploy tested changes to production organizations on Enterprise Edition or Unlimited Editions. You can also create scripts to populate a new organization with your custom objects, custom fields, and other components.

 

Does this means that the create(), update() and delete() calls of the Metadata API in a client running elsewhere outside salesforce would only work when calling a test/sandbox or developer orgs, and will not work for an Enterprise and Unlimited orgs ?.

 

Thank you very much in advance.

 

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata">
<sessionId>...</sessionId>
</SessionHeader>
<CallOptions xmlns="http://soap.sforce.com/2006/04/metadata">
<client>...</client>
</CallOptions>
</S:Header>
<S:Body>
<create xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Folder">
<fullName>testFolderFullName</fullName>
<accessType>Public</accessType>
<name>testFolderName</name>
</metadata>
</create>
</S:Body>
</S:Envelope>

 

When submitting the above XML, the server responds with a 500 and the following error:

 

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

 

 

However, the following xml gets a 200 back (and actually does create the metadata object).

 

 

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata">
<sessionId>...</sessionId>
</SessionHeader>
<CallOptions xmlns="http://soap.sforce.com/2006/04/metadata">
<client>...</client>
</CallOptions>
</S:Header>
<S:Body>
<create xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CustomField">
<fullName>Lead.foobar__c</fullName>
<label>foo label</label>
<length>28</length>
<type>Text</type>
</metadata>
</create>
</S:Body>
</S:Envelope>

 

 

 

Both requests have the "type" attribute on the "metadata" element in the correct namespace. Any idea why the second works while the first doesn't? (The second does have a "type" sub-element, but that's a property of CustomField specifically.)

Hi,

 

I am having difficulty with attempting to create a new custom object. I have a valid connection etc. (In this case to a sandbox).

 

The login credentials have sysadmin rights.

 

The error I get is "Unable to determine type mapping for type CustomObject.  Type is illegal here."

 

I have no idea what the issue is. 

 

I have posted the SOAP request below (header removed).

 

 

<?xml version="1.0" encoding="utf-8"?> <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> {Header removed} </SOAP-ENV:Header> <SOAP-ENV:Body xmlns="http://tempuri.org/"> <create xmlns="http://soap.sforce.com/2006/04/metadata"> <metadata xsi:type="ns1:CustomObject"> <fullName>MYOB__c</fullName> <customSettingsType>List</customSettingsType> <deploymentStatus>Deployed</deploymentStatus> <description>This is a test Object created using the Metadata API.</description> <enableActivities>true</enableActivities> <fields> <fullName>MyField__c</fullName> <description>This is a description of a custom field.</description> <formulaTreatBlanksAs>BlankAsBlank</formulaTreatBlanksAs> <label>My Custom Field</label> <maskChar>asterisk</maskChar> <maskType>all</maskType> <picklist> <sorted>false</sorted> </picklist> <summaryOperation>count</summaryOperation> <type>Text</type> </fields> <gender>Neuter</gender> <label>Mind Your Own Business</label> <nameField> <formulaTreatBlanksAs>BlankAsBlank</formulaTreatBlanksAs> <maskChar>asterisk</maskChar> <maskType>all</maskType> <picklist> <sorted>false</sorted> </picklist> <summaryOperation>count</summaryOperation> <type>AutoNumber</type> </nameField> <pluralLabel>Mind Your Own Businesses</pluralLabel> <searchLayouts /> <sharingModel>ReadWrite</sharingModel> <startsWith>Consonant</startsWith> </metadata> </create> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

 

 

 

 

 Any help is appreciated.

Hi All,

 

I would like to be able to call the SF Metadata API from Apex code in my custom app.

 

I went to Setup/App Setup/Develop/API and clicked on 'Download Metadata WSDL' and saved it to my hard drive.

 

Then I went to Setup/App Setup/Develop/ApexClasses and clicked on the 'Generate from WSDL' button. For Step 1, I navigate to the Metadata WSDL that I just saved and click 'Parse WSDL.' This takes me to the Step 2 screen where I then click on the 'Generate Apex code' button.

 

This takes me to the Step 3 screen which shows this error:

 

<error>

Apex generation failed.

Error message:
Error: Class name 'Metadata' already in use. Please edit WSDL to remove repeated names

 

</error>

 

Does this error mean that what I am attempting to do is not allowed? If it is allowed, how do I get around this error.

 

Any help would be appreciated.

 

Thanks,

Andrew

 Does anyone know how to update picklist value from metadata api?

 I wrote an xml message as followings referring http://www.salesforce.com/us/developer/docs/api_meta/index.htm, but it does not work well.

 

In this case, with the first picklist values that currentname and fullname are different,  it supposed to be updating the picklist  value. but on the contrary as result, this picklist would have 3 picklist values -

"next month", "this month", "xxxx".

 

 The value of "this month" is being treated as new picklist value...any clue on this..?

 

*********************

<soapenv:Body>
 <update>
  <UpdateMetadata>
  <currentName>Account.salaryDay__c</currentName>
  <metadata xsi:type="ns2:CustomField">
    <fullName>Account.salaryDay__c</fullName>
    <label>payday</label>
    <type>Picklist</type>
    <picklist>
     <sorted>true</sorted>
     <picklistValues>
      <currentName>next month</currentName>
      <fullName>this month</fullName>
     </picklistValues>
     <picklistValues>
      <currentName>xxxx</currentName>
      <fullName>xxxx</fullName>
     </picklistValues>

   ....

   </soapenv:Body>
  </update>
 </UpdateMetadata>

*********

 

Thank you so much

Is there a way to get the "id" of a picklist value through the API?  We are using picklist values in an external system and when a picklist value is updated, would like to "push" this updated value to the external system via the id.

 

Looking at the edit page, it seems it may be possible to get at the id, but I do not see this available through the API.  Is there a way to get this id value?

 

Examples through the edit screen:
picklist_masteredit.jsp?id=01J400000088LJZ
picklist_masteredit.jsp?id=01J400000088LJa

 

Thanks!

I've managed to write code that inserts a value into a picklist field from my c# web application.  However, it is VERY clunky and I still can't figure out how to keep from losing some of the field properties.

 

First, it seems a little silly to have to programmatically recreate the entire picklist field just so I can update it with one new value in the picklistValues property.  Also, I have to do a describeSObject and then step through all the fields looking for the right field name.  Isn't there a way to just grab the metadata for a field directly?  I've seen code like the following, but....

Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.MyFieldName__c;

 ...but, I don't seem to have the Schema namespace/library at my disposal from the C# environment.  Is there ANY way to get DescribeFieldResult functionality in C#?

 

So I loop through the fields in the object, find the one I want, step through each of the picklist values and recreate them in a new array.  Then I add my new entry to the picklist values array and save it to the picklistValues property.  I can update the field and the new value does in fact show up in Salesforce.... but...

 

...another problem is that I end up losing the Picklist.Description and Picklist.Sorted properties because the Field object that I'm reading from doesn't have that information.

Well, enough words from me, here is the code.  This works, but you lose the Description and Sorted settings each time.  I post it in hopes that it helps someone and that perhaps someone can help us figure out the rest.

 

 

public void InsertPicklistValue(string objectName, string picklistFieldName, string valueToInsert) { try { // Load describe info for the object. DescribeSObjectResult descSObjectRslt = c_sfEnterprise.describeSObject(objectName); if (descSObjectRslt != null) { Field[] fields = descSObjectRslt.fields; foreach (Field field in fields) { if (field.name == picklistFieldName) { // Get the array of existing picklist entries. PicklistEntry[] picklistEntries = field.picklistValues; // We have to recreate the entire list of existing picklist values... List<PicklistValue> pVals = new List<PicklistValue>(); PicklistValue pVal; foreach (PicklistEntry picklistEntry in picklistEntries) { pVal = new PicklistValue(); pVal.@default = picklistEntry.defaultValue; if (picklistEntry.label != null) pVal.fullName = picklistEntry.label; else pVal.fullName = picklistEntry.value; pVals.Add(pVal); } // Add the NEW value... pVal = new PicklistValue(); pVal.fullName = valueToInsert; pVals.Add(pVal); // Now that we have the values, we need to save them to a new picklist. Picklist pList = new Picklist(); pList.picklistValues = pVals.ToArray(); //pList.sorted = how can we get this from the existing field? CustomField picklistField = new CustomField(); picklistField.fullName = objectName + "." + picklistFieldName; picklistField.label = field.label; picklistField.type = FieldType.Picklist; picklistField.picklist = pList; picklistField.inlineHelpText = field.inlineHelpText; //picklistField.description = how/where can we get this? // Update the existing picklist. UpdateMetadata updatedMetadata = new UpdateMetadata(); updatedMetadata.currentName = objectName + "." + picklistFieldName; updatedMetadata.metadata = picklistField; AsyncResult result = update(new UpdateMetadata[] { updatedMetadata })[0]; while (!result.done) { System.Threading.Thread.Sleep(result.secondsToWait * 1000); result = checkStatus(new string[] { result.id })[0]; } if (result.state == AsyncRequestState.Error) Console.WriteLine("Error {0}\n{1}", result.statusCode, result.message); else Console.WriteLine("Picklist updated successfully"); break; } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("\nFailed to get " + objectName + " description, error message was: \n " + ex); } }

 

 

Anyone?  Bueller?

 

 

 

Is there a example of how to add a custom field to an existing custom object? In the sample script, it only shows how to create a custom object.
Nick,
 
Maybe I need to rephrase my Subject line, but I see some shortcomings using the metadata API.  In your example you have:
 
$customObject->setDescription("A description");
 
AND
 
$customField->setDescription('Description of New Field');
 
 
 
to set the descriptions on the new object and field(s), but the shortcoming is that a developer cannot get the description from one organization to another.  So if I have a custom object with a description in my production org/instance, I cannot move that to another org/instance or am I missing this somewhere?
 
~Mike