Open gribis opened 5 years ago
@daveespo @stohn777 Is there already some update about this problem? I ran into this issue again today. How do you advise we resolve this issue?
@gribis or @wimvelzeboer -- can you provide a repro case (ideally a CMDT object definition and Selector class that reproduces this problem) ?
repro steps:
testSelector class:
public with sharing class TestSelector extends fflib_SObjectSelector {
public TestSelector() {
super(false, true, true, false);
}
public List<Schema.SObjectField> getSObjectFieldList() {
return new List<Schema.SObjectField>{ Test__mdt.Id };
}
public Schema.SObjectType getSObjectType() {
return Test__mdt.SObjectType;
}
public List<Test__mdt> selectAll() {
fflib_QueryFactory qf = newQueryFactory();
qf.selectFields(new List<String>{'Entity__r.QualifiedApiName', 'Field__r.QualifiedApiName'});
return Database.query(qf.toSOQL());
}
}
new TestSelector().selectAll();
is this fixed somehow?
When custom metadata tables include references to related metadata (e.g. Entity or Field Definitions), fflib_QueryFactory throws an exception.
The field definition for such a reference shows next to nothing of value; SoapType = String, isIdLookup = false, getRelationshipName = null. Short of avoiding the selector/queryfactory constructs, what are some simple fixes to the above conundrum?