You need to sign in to do that
Don't have an account?
Swati Bhaip
JSONObject leadField = new JSONObject();
leadField.put("Field Label", "Home");
leadField.put("Field Name","Home");
PostMethod post = new PostMethod(instanceUrl
+ "/services/data/v20.0/sobjects/Lead/LeadCustomField");
I can write this sample code for creating Lead Custom Field using Rest Api but the passing url to PostMethod is not working Please Help me for creating a Lead custom Field using Rest Api.
CustomField
JSONObject leadField = new JSONObject();
leadField.put("Field Label", "Home");
leadField.put("Field Name","Home");
PostMethod post = new PostMethod(instanceUrl
+ "/services/data/v20.0/sobjects/Lead/LeadCustomField");
I can write this sample code for creating Lead Custom Field using Rest Api but the passing url to PostMethod is not working Please Help me for creating a Lead custom Field using Rest Api.
REST API is used to fetch and create data(records) in salesforce but METADATA API is the one which deals with creation of objects/fields etc
https://www.salesforce.com/us/developer/docs/api_meta/
Hoping I've understood your requirement correctly..
http://salesforce.stackexchange.com/questions/18843/using-meta-data-api-in-apex