Say I have a master-detail relationship between two objects,
I can SOQL query the master from the detail:
[SELECT Schematic__r.Name FROM Part__c]
If I'm building a query from strings, I resolve the schema name, for example in a managed package:
SObjectType.Part__c.Fields.Schematic__c.Name //gives me 'ns__Schematic__c'
But when traversing into the master object, the
__r relationship suffix is what I need to surface. I've toyed around with the obvious Schema.SObjectType variations but I'm not having much luck:
SObjectType.Part__c.Fields.Schematic__r.Name //Schematic__r is not a field of ns__Symbol__c
What's the correct way to resolve the
ns__Schematic__r.Name token without replacing the suffix?