I'm receiving a bug from an production enviroment that is totally strange for me. The same query give different results based on the fields present in the query. I give you an example on the query Made:
Select id, LogisticaContatto__c From order where id='801w0000003OaluAAC'
This Query returns 0 results.
While the same query without the custom field returns correctly the record, as expected.
Select id From order where id='801w0000003OaluAAC'
the custom field
LogisticaContatto__cis an formula field that reads some values via lookup. This is happening with only this field.
I'm not understanding what is happening. Do you have any similar experience and a reasonable logic that this should happen?
The logic on the formula field is this
IF(TEXT(Type__c)='Constant1', IF( NOT( ISBLANK(Inst__r.PersonMobilePhone)),Inst__r.PersonMobilePhone, IF( NOT( ISBLANK(Inst__r.Phone)),Inst__r.Phone, IF( NOT( ISBLANK(Inst__r.PersonHomePhone)),Inst__r.PersonHomePhone, Inst__r.PersonOtherPhone ) ) ) , IF( Account.RecordType.Name ='Business', Account.Phone , IF( NOT( ISBLANK(Account.PersonMobilePhone)),Account.PersonMobilePhone, IF( NOT( ISBLANK(Account.Phone)),Account.Phone, IF( NOT( ISBLANK(Account.PersonHomePhone)),Account.PersonHomePhone, Account.PersonOtherPhone ) ) ) ) )