You need to sign in to do that
Don't have an account?
Metadata API errors: Must specify a type attribute value for the metadata element
<?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.)
Figured it out. The issue is not that the type attribute is missing; the problem is that Folder is not allowed as a type. (It would be nice if the error message was more useful...)
Specifically, you need to use a sub-type of Folder, e.g. DocumentFolder.
All Answers
Figured it out. The issue is not that the type attribute is missing; the problem is that Folder is not allowed as a type. (It would be nice if the error message was more useful...)
Specifically, you need to use a sub-type of Folder, e.g. DocumentFolder.
is there any way to edit picklist value through metadat API .
I am current testing meta data API via SOAP ui and till now I am able to add picklist values .
but can not edit any perticuler picklist value
eg . object : lead
field : number__c
type : picklist
values : 1 , 2
any methode i cn edit 1 to 11 ??