function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sourav PSourav P 

To extract the list of fields on an object and related used cases on flows, codes etc

Dear All
Do we have any ways or Can we write an apex code, that i can extract the fields of an object, and where its been used, if on PB, WF, apex code etc.
 
Now if i want to know where a field been used,  have to take teh risk of delete it, so that it will show the dependencies of that field. If there is none, it get deleted. So, if i can get the list easier for me to decide which fields are not in use and can delete it. Thanks
Best Answer chosen by Sourav P
NagendraNagendra (Salesforce Developers) 
Hi Sourav,

To get all fields of an object  you need to access the schema class in the apex class like this 

describeSObjects(sObjectTypes)
Describes metadata (field list and object properties) for the specified sObject or array of sObjects.

For more details please refer this link to get the dependencies you need to use the toodling APIs
  • https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_schema.htm
Also, check with below apps from app exchange:

Paid:
  • https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000E1hcOUAR
Free:
  • https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B5ekWEAR
Upvote This Idea:
  • https://success.salesforce.com/ideaView?id=08730000000Br56AAC
Thanks,
Nagendra