Newer Version Available
Tooling API Examples
To retrieve information about fields created with Custom Address Fields, such as the
developer name, use Tooling API.
Get Information About a Custom Address Field on a Record
This example uses the CustomField REST HTTP
GET method to retrieve information about the Mailing_Address__c custom address field, with
the CustomField ID 00NXXXXXXXXXXXXXXX.
- HTTP GET example to retrieve information about a custom address field on a record
-
1curl https://MyDomainName.my.salesforce.com/services/data/63.0/tooling/sobjects/CustomField/00NXXXXXXXXXXXXXXX -H "Authorization: Bearer token
- Example response
-
1{ 2 "attributes": { 3 "type": "CustomField", 4 "url": "https://MyDomainName.my.salesforce.com/services/dataa63.0/tooling/sobjects/CustomField/00NXXXXXXXXXXXXXXX" 5 }, 6 "Id": "00NXXXXXXXXXXXXXXX", 7 "TableEnumOrId": "Account", 8 "DeveloperName": "caf", 9 "Description": null, 10 "Length": null, 11 "Precision": 18, 12 "Scale": 15, 13 "RelationshipLabel": null, 14 "SummaryOperation": null, 15 "InlineHelpText": null, 16 "MaskType": null, 17 "MaskChar": null, 18 "NamespacePrefix": null, 19 "ManageableState": "unmanaged", 20 "CreatedDate": "2021-04-07T06:57:22.000+0000", 21 "CreatedById": "005XXXXXXXXXXXXXXX", 22 "LastModifiedDate": "2021-04-07T06:57:22.000+0000", 23 "LastModifiedById": "005XXXXXXXXXXXXXXX", 24 "EntityDefinitionId": "Account", 25 "Metadata": { 26 "businessOwnerGroup": null, 27 "businessOwnerUser": null, 28 "businessStatus": null, 29 "caseSensitive": null, 30 "complianceGroup": null, 31 "customDataType": null, 32 "defaultValue": null, 33 "deleteConstraint": null, 34 "deprecated": null, 35 "description": null, 36 "displayFormat": null, 37 "displayLocationInDecimal": null, 38 "encryptionScheme": null, 39 "escapeMarkup": null, 40 "externalDeveloperName": null, 41 "externalId": false, 42 "formula": null, 43 "formulaTreatBlanksAs": null, 44 "inlineHelpText": null, 45 "isAIPredictionField": null, 46 "isConvertLeadDisabled": null, 47 "isFilteringDisabled": null, 48 "isNameField": null, 49 "isSortingDisabled": null, 50 "label": "caf", 51 "length": null, 52 "lookupFilter": null, 53 "maskChar": null, 54 "maskType": null, 55 "metadataRelationshipControllingField": null, 56 "mktDataLakeFieldAttributes": null, 57 "mktDataModelFieldAttributes": null, 58 "populateExistingRows": null, 59 "precision": null, 60 "readOnlyProxy": null, 61 "referenceTargetField": null, 62 "referenceTo": null, 63 "relationshipLabel": null, 64 "relationshipName": null, 65 "relationshipOrder": null, 66 "reparentableMasterDetail": null, 67 "required": null, 68 "restrictedAdminField": null, 69 "scale": null, 70 "securityClassification": null, 71 "startingNumber": null, 72 "stripMarkup": null, 73 "summarizedField": null, 74 "summaryFilterItems": null, 75 "summaryForeignKey": null, 76 "summaryOperation": null, 77 "trackFeedHistory": false, 78 "trackHistory": null, 79 "trackTrending": null, 80 "translateData": null, 81 "type": "Address", 82 "unique": null, 83 "urls": null, 84 "valueSet": null, 85 "visibleLines": null, 86 "writeRequiresMasterRead": null 87 }, 88 "FullName": "Account.caf__c" 89}
Query Information About a Custom Address Field on a Record
This example uses the CustomField REST HTTP
Query method to retrieve the developer name of the Mailing_Address__c custom address field
with CustomField ID 00NXXXXXXXXXXXXXXX.
- Example query to retrieve the DeveloperName for a custom address field
-
1Select+id,DeveloperName+from+CustomField+where+Id='00NXXXXXXXXXXXXXXX' - HTTP Query example to retrieve information using the query
-
1curl https://MyDomainName.my.salesforce.com/services/data/63.0/tooling/query?q=Select+id,DeveloperName+from+CustomField+where+Id='00NXXXXXXXXXXXXXXX -H "Authorization: Bearer token" - Example response
-
1{ 2 "size": 1, 3 "totalSize": 1, 4 "done": true, 5 "queryLocator": null, 6 "entityTypeName": "CustomField", 7 "records": [ 8 { 9 "attributes": { 10 "type": "CustomField", 11 "url": "/services/data/v54.0/tooling/sobjects/CustomField/00NXXXXXXXXXXXXXXX" 12 }, 13 "Id": "00NXXXXXXXXXXXXXXX", 14 "DeveloperName": "Mailing_Address" 15 } 16 ] 17}