how to check thru code, if a field is referred / used anywhere in any of our apex code / vf page / component ?
Assume I have a field called ApplicationNumber__c
Say I have a list of apex classes :-
out of which a,b,c are referring/using the field ApplicationNumber__c and d,e,f are not.
same way, say I have a list of pages (probably using standard controller) :-
out of which w,x is using this field and y,z is not.
I know if I try to delete this field, it tells me where all the field is referred. Is there any way to fetch this information thru apex code?
I know that this could be done through metadata api and eclipse. But it would be great if we could do that through apex. any suggestions?
I also came across an appexchange tool called FieldTrip which does this.
But I want to build something custom, like a visualforce page, where I will just choose my application name and it should list all fields of that app, that are unused and this has to be done through apex.
So am just asking for a hint as to how I can get the fields referenced in classes,triggers and other components through apex.