You need to sign in to do that
Don't have an account?
CP_PD
Adding a picklist value via Salesforce API Version 37 with C#/.NET
Some years ago, I created a Synkronization between Dynamics NAV and Salesforce via API version 24, and works fine :-)
Now I ned to call Salesforce API Version 37. I have downloaded sforce and metadata WSDL files, and everything is ok - except for one thing: Addiing a piclist value to a picklist.
API Version 24
In this version I read the picklist value one by one and created a new picklist. Finaly I added the piclist like:
API Version 37
WSDL metadata no longer have the type UpdateMetadata, from where I added the picklist in API version 24. I can read elements of the picklist, but I cannot add the list.
I have "asked Google", if he could help me, but I got no response.
(for API Version 37)
I you have a piece of code adding a picklist though API 37, I would be greatful.
Now I ned to call Salesforce API Version 37. I have downloaded sforce and metadata WSDL files, and everything is ok - except for one thing: Addiing a piclist value to a picklist.
API Version 24
In this version I read the picklist value one by one and created a new picklist. Finaly I added the piclist like:
// Update the existing picklist. UpdateMetadata umd = new UpdateMetadata(); umd.currentName = tableName + "." + fieldName; umd.metadata = picklistField; MetadataService mds = new MetadataService(); mds.SessionHeaderValue = new metadata.SessionHeader(); mds.SessionHeaderValue.sessionId = sessionID; mds.Url = metadataURL; AsyncResult result = mds.update(new UpdateMetadata[] { umd })[0];
API Version 37
WSDL metadata no longer have the type UpdateMetadata, from where I added the picklist in API version 24. I can read elements of the picklist, but I cannot add the list.
I have "asked Google", if he could help me, but I got no response.
(for API Version 37)
I you have a piece of code adding a picklist though API 37, I would be greatful.
The above will replace the existing picklist values with "Unsubmitted" and "Submitted". Hope that helps.
All Answers
The above will replace the existing picklist values with "Unsubmitted" and "Submitted". Hope that helps.
Unfortunately, it does not work :-(
I create the picklist dynamically.
I get this error, when calling Salesforce API:
"Must specify a FieldType"
But I have specified a FieldType. (see my code below)
statusField.typeSpecified = true;
hat you mensioned. And now it works fine :-)
Thank you