Describe the bug
The Schema.SObjectField getField(String, Boolean) method in fflib_SObjectDescribe does not resolve cross-object paths when those paths are Person Account specific. In the Person Account scenario, the path would be from a custom field on the Contact object to a field on the Account object. In that case, the relationship path would end with __pr and not the typical __r.
The fflib_SObjectDescribe class needs to be adjusted to handle this scenario correctly.
To Reproduce
Setup a custom field lookup from Contact to Account where Person Account feature is enabled.
Use fflib_SObjectDescribe.getField(String, Boolean) method to resolve the field path
Expected behavior
The custom field on the Contact object should be returned
Screenshots and text of error observed
The method returns null
Describe the bug The
Schema.SObjectField getField(String, Boolean)
method infflib_SObjectDescribe
does not resolve cross-object paths when those paths are Person Account specific. In the Person Account scenario, the path would be from a custom field on the Contact object to a field on the Account object. In that case, the relationship path would end with__pr
and not the typical__r
.The
fflib_SObjectDescribe
class needs to be adjusted to handle this scenario correctly.To Reproduce
fflib_SObjectDescribe.getField(String, Boolean)
method to resolve the field pathExpected behavior The custom field on the Contact object should be returned
Screenshots and text of error observed The method returns null
Version Latest version as of 8/23/2023