0

is there a way to list all the fields both standard and custom for a given object.

tooling api - customfield gives only list of custom fields but not the standard fields.

2 Answers 2

2

You can just use describes.

List<SObjectField> allFields = SObjectType.My_Object__c.fields.getMap().values();
2
  • Is there a way to get the lastmodified date of the custom field ?
    – ab0369
    Jan 22, 2019 at 14:51
  • @ab0369 That is a different question which has been answered here (just replace CreatedBy with LastModifiedBy). You need to use the Tooling API for that. You will have to use an endpoint/class with API Version >= 33.0.
    – Adrian Larson
    Jan 22, 2019 at 14:53
1

For API services, you can call either the REST describe call or SOAP describe call.

REST

/services/data/v44.0/sobjects/Account/describe

SOAP

client.describeSObject("Account")

The Developer Console actually has a third option. Click on File > Open Resource, and type in the object's name, such as Account.obj or Loan__c.obj.

1
  • Is there a way to get the lastmodified date of the custom field ?
    – ab0369
    Jan 22, 2019 at 14:51

You must log in to answer this question.

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