As part of the implementation of an API, I would like to be able to find the
SObjectType
from theSObjectField
:public class MyClass { // Fields are from various SObjects public void myMethod(SObjectField[] fs) { for (SObjectField f : fs) { DescribeFieldResult dfr = f.getDescribe(); SObjectType t = ...; ...; } } }
but even in the describe results it does not appear to be present. Am I missing something?
Answer
I don’t believe this is possible currently. There’s no methods on Schema.SObjectField of Schema.DescribeFieldResult that link back to the SObjectType that field belongs to.
Attribution
Source : Link , Question Author : Keith C , Answer Author : ca_peterson