• Developer Surveypal
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi, 

I've been working with the Meta API for few days and noticed that my custom fields created via API are not visible in the "Describe" resource of the REST API "/services/data/v38.0/sobjects/MyCustomObject__c/describe" however, I can see the custom fields created in the Setup -> Create -> Custom objects view inside my salesforce instance. Is there some update TTL for this type of changes? or there is some attributes in the Custom Field that needs to be set to enable it. Or it is just not possible to use REST API and META API together?

I am using the JAVA api library:
com.force.apiforce-metadata-api-38.0.0

And adding custom field code is the following (simplified):
CustomField field = new CustomField(); 
field.setType(FieldType.Text); 
field.setDescription(description); 
field.setLabel("answerid"); 
field.setFullName("answerid__c"); 
field.setLength(lenght);

customObject.setFields(new CustomField[] {field});
UpsertResult[] results = metadataConnection.upsertMetadata(new Metadata[]{ customObject });
It returns a success result, and as I commented, I able to see the field in the tool, however, I cannot use the field when creating instances of the custom object, and it does not show up in the REST API "describe" resource of my custom object.

Is there something I am missing ??