Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sfdx-source/apex-common/main/classes/fflib_QueryFactory.cls
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
fflib_SecurityUtils.checkFieldIsReadable(lastSObjectType, token);
}

if (token != null && i.hasNext() && tokenDescribe.getSoapType() == Schema.SoapType.ID) {
if (token != null && i.hasNext() && (tokenDescribe.getSoapType() == Schema.SoapType.ID
|| (tokenDescribe.getSoapType() == Schema.SoapType.STRING && tokenDescribe.getType() == Schema.DisplayType.REFERENCE))) {
List<Schema.sObjectType> relatedObjs = tokenDescribe.getReferenceTo(); //if it's polymorphic, it matters which one we use - i.e. Lead.Owner is GROUP|USER and each has different fields.

if (relatedObjs.size() == 1 || relatedSObjectType == null) {
Expand Down