I get this error id (1417884933-3641 (-2142224028)) when i try to use the Metadata API(.Net) to create a custom object with fields
This is my sample code
CustomObject co = new CustomObject();
co.deploymentStatus = DeploymentStatus.Deployed;
co.deploymentStatusSpecified = true;
co.enableActivities = true;
co.description = objectName;
co.fullName = "TestObj__c"
co.label = "TestObj";
co.pluralLabel = "TestObjs";
co.sharingModel = SharingModel.ReadWrite;
co.sharingModelSpecified = true;
CustomField nameField = new CustomField();
nameField.fullName = "TestObj Name"
nameField.type = FieldType.Text;
nameField.typeSpecified = true;
nameField.label = "Name Field"
co.nameField = nameField;
CustomField customField1 = new CustomField();
customField1.fullName = "TestObj__c.TestField__c";
customField1.type = FieldType.Text;
customField1.typeSpecified = true;
customField1.label = "Test Field";
co.fields = new CustomField[] { customField1 };
SaveResult[] results = ms.createMetadata(new metaforce.Metadata[] { co });
It throws the exception at the createmetadata call
EDIT:- If i don't specify the custom field name as "TestObj__c.TestField__c" but do something like
customField1.fullName = "Test Field";
i don't get any exception and the custom object "TestObj" is created but there are no custom fields in the object
results.errors[0].message
try { SaveResult[] results = ms.createMetadata(new metaforce.Metadata[] { co }); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); }