You need to sign in to do that
Don't have an account?

Please help me write the SOQL query.
I have a situation where I have two objects Opportunity and a custom Object Contract__c. In both the object I have a field called reference_name__c. Now the situation is that I have to query the objects and return the reference_name__c values. If Opportunity has reference_name__c value and Contract__c don't have reference_name__c value return value. If Opportunity has no reference_name__c value and Contract__c has reference_name__c value then return the value. How could I write the query? The query was written by me just satisfies the 1st condition. Please help me with the query.
Select Id, reference_name__c,(Select ID, reference_name__c from Contract__r where reference_name__c !=null Limit 10) from opportunity where AccountId != null AND reference_name__c != null AND Owner.AccountId =loggedInUser.Contact.AccountId limit 10
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
All Answers
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
you can try like below:
Thanks,
Maharajan.C
Dinar Detectives Update(https://www.dinarguru.onl/)