You need to sign in to do that
Don't have an account?
Sharankumar Desai
Metadata wsdl API to create picklist field with picklist values
Hi All,
I am using Metadata WSDL along with Partner WSDl to work on metadata API to create fields.
I am able to create fields of type text,checkbox etc, but i am facing using to create a picklist field and add picklist values to it.
Below is the cource code i have written i am not able to understand where to add the picklist values
I have seen forums where people says to use
SALESFORCE VERSION : 39.0
NOTE: I am using Java appilcation for doing this job
Appreciate your help !!
I am using Metadata WSDL along with Partner WSDl to work on metadata API to create fields.
I am able to create fields of type text,checkbox etc, but i am facing using to create a picklist field and add picklist values to it.
Below is the cource code i have written i am not able to understand where to add the picklist values
CustomField customField = new CustomField(); customField.setFullName("Account.customPickField__c"); customField.setLabel("customPickField"); customField.setType(FieldType.Picklist); SaveResult[] results = metadataConnection.createMetadata(new Metadata[] {customField});
I have seen forums where people says to use
customField.setPicklist();But this method is not available .
SALESFORCE VERSION : 39.0
NOTE: I am using Java appilcation for doing this job
Appreciate your help !!
You can make an HTTP Callout like the below one. You just need to change the XML and find the appropriate tags to set the picklist values and other properties. I used this to create custom fields and assignment rules. I hope it will help you. PLEASE MARK IT AS THE BEST ANSWER IF IT WORKS FOR YOU.
Thanks,
Gaurish
http://www.gaurishgoel.com (http://www.gaurishgoel.com" target="_blank)
I am not looking for Callouts, thats my question that these tags to set Picklistvalue is not available.
I have generated jar file from the wsdl and using in my java application.