You need to sign in to do that
Don't have an account?
Khalid Abdullah
SOQL: How do you return records if OwnerId of the main object and the OwnerId of the Lookup Object do not Match?
Hello all!
Novice question here: Trying to write a SOQL query which will compare the OwnerId of the Contact to the OwnerId of the Lookup Relationship Object and return only records where OwnerIds on both objects don't match.
The two objects are:
1. Contacts (Main Object)
2. Lookup Relationship: Sub Zones (Zone__c)
The Contacts object contains a field with a lookup relationship to the Sub Zones Object (Zone__c)
Both the Contact and the Sub Zone have an owner. We assign Sub Zones if the owners are both are identical.
How would I write a SOQL Query to find the records where they do not match?
Novice question here: Trying to write a SOQL query which will compare the OwnerId of the Contact to the OwnerId of the Lookup Relationship Object and return only records where OwnerIds on both objects don't match.
The two objects are:
1. Contacts (Main Object)
2. Lookup Relationship: Sub Zones (Zone__c)
The Contacts object contains a field with a lookup relationship to the Sub Zones Object (Zone__c)
Both the Contact and the Sub Zone have an owner. We assign Sub Zones if the owners are both are identical.
How would I write a SOQL Query to find the records where they do not match?
- Sai
All Answers
- Sai
Thanks so much for your post, we were spinning our wheels on this for quite some time but it's good to know we should just create a custom field for it and proceed that way (at least until an enhancement is introduced to the SOQL environment for this).
Best regards,
Khalid Abdullah