I am trying to create an oAuth based app that integrates with salesforce to create the objects from the app.

To let users know what all fields that users needs to put in at minimum to create the object the logic is as below:

if the field is createable && field is NOT nillable && (field is NOT DefaultedOnCreate OR (field is DefaultedOnCreate AND field has default value as null))

Same thing we found on the forum https://developer.salesforce.com/forums?id=906F00000008x86IAA The best answer was that same logic chosen by the admin.

But for some objects this logic is is not correct, e.g. to create a user this logic gives "IsStayInTouchRequired" as a mandatory field and it is not required by salesforce.

Please suggest the correct logic for finding the mandatory fields.

Thanks in advance.

1 Answer 1


You'll want to use the Get Record Layout Metadata to get the appropriate requireness per record type. This is part of the UI API.

  • Is there a list of object types that can be called using this API. e.g. invoking for email template and task gives error: Object Task is not supported in UI API" Aug 29, 2018 at 16:59
  • @ThingworxSymphony there's an API for that.
    – sfdcfox
    Aug 29, 2018 at 17:02
  • This API is working for very few of the objects like account, lead, opportunity etc. But we need this information for all the sobjects like Folder, Task, Event etc.. Is there a way to achieve this? Aug 30, 2018 at 9:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .