required
is an attribute of Metadata
field on FieldDefinition
entity. The Metadata
field is of type CustomField
and this field type has your attribute. To pull the Metadata
field via a Tooling API query on an entity, you have to limit the query to return exactly 1 record in your result set by filtering on DurableId
. Tooling REST API resource:
/services/data/v46.0/tooling/query?q=SELECT+Label,DurableId,EntityDefinitionId,Metadata+FROM+FieldDefinition+WHERE+DurableId='Account.Id'
yields this response:
{
"size" : 1,
"totalSize" : 1,
"done" : true,
"queryLocator" : null,
"entityTypeName" : "FieldDefinition",
"records" : [ {
"attributes" : {
"type" : "FieldDefinition",
"url" : "/services/data/v46.0/tooling/sobjects/FieldDefinition/Account.Id"
},
"Label" : "Account ID",
"DurableId" : "Account.Id",
"EntityDefinitionId" : "Account",
"Metadata" : {
"businessOwnerGroup" : null,
"businessOwnerUser" : null,
"businessStatus" : null,
"caseSensitive" : null,
"customDataType" : null,
"defaultValue" : null,
"deleteConstraint" : null,
"deprecated" : null,
"description" : null,
"displayFormat" : null,
"displayLocationInDecimal" : null,
"encryptionScheme" : null,
"escapeMarkup" : null,
"externalDeveloperName" : null,
"externalId" : null,
"formula" : null,
"formulaTreatBlanksAs" : null,
"inlineHelpText" : null,
"isAIPredictionField" : null,
"isConvertLeadDisabled" : null,
"isFilteringDisabled" : null,
"isNameField" : null,
"isSortingDisabled" : null,
"label" : null,
"length" : null,
"lookupFilter" : null,
"maskChar" : null,
"maskType" : null,
"metadataRelationshipControllingField" : null,
"populateExistingRows" : null,
"precision" : null,
"readOnlyProxy" : null,
"referenceTargetField" : null,
"referenceTo" : null,
"relationshipLabel" : null,
"relationshipName" : null,
"relationshipOrder" : null,
"reparentableMasterDetail" : null,
"required" : null,
"restrictedAdminField" : null,
"scale" : null,
"securityClassification" : null,
"startingNumber" : null,
"stripMarkup" : null,
"summarizedField" : null,
"summaryFilterItems" : null,
"summaryForeignKey" : null,
"summaryOperation" : null,
"trackFeedHistory" : null,
"trackHistory" : null,
"trackTrending" : null,
"translateData" : null,
"type" : null,
"unique" : null,
"urls" : null,
"valueSet" : null,
"visibleLines" : null,
"writeRequiresMasterRead" : null
}
} ]
}