diff --git a/force-app/repository/Query.cls b/force-app/repository/Query.cls index 30b7ad3..6df1c13 100644 --- a/force-app/repository/Query.cls +++ b/force-app/repository/Query.cls @@ -109,7 +109,7 @@ public virtual class Query { Schema.DescribeFieldResult parentFieldDescribe = parentFields[index].getDescribe(); builtUpFieldName += index == parentFields.size() - 1 ? parentFieldDescribe.getName() - : parentFieldDescribe.getRelationshipName() + '.'; + : parentFieldDescribe.getRelationshipName() ?? parentFieldDescribe.getName().replace('__c', '__r') + '.'; } return builtUpFieldName; }