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
champ_vimalchamp_vimal 

Update Metadata API call error

Hi,

 

I have created a java application which tries to update the metadata in SFDC. I used the following snippet:-

 

CustomObject co = 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);
CustomField nf = new CustomField();
nf.setType(FieldType.Text);
nf.setLabel(co.getFullName() + " Name");
co.setNameField(nf);
UpdateMetadata updateMetadata = new UpdateMetadata();
updateMetadata.setMetadata(co);
updateMetadata.setCurrentName(co.getFullName());

com.sforce.soap._2006._04.metadata.AsyncResult[] ars_F = clnt.getMetadatabinding().update(new UpdateMetadata[]{updateMetadata});

 

But I got the error: 'Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element'

 

Can someone please assist me in this?

 

Thanks,

 

Vimal

SuperfellSuperfell
This is a bug in the version of axis you are using. Try using the latest verison of axis 1.x