You need to sign in to do that
Don't have an account?
Ankit Gupta SFDCLearner
SOQL not working for custom object
Just want to fetch no of parents records who have no child records, I need it's SOQL. Below soql is running for standard object SELECT Id, Name FROM Account WHERE Id NOT IN (SELECT AccountId FROM Opportunity)
I need it for custom object. Please try to solve.
I need it for custom object. Please try to solve.
Greetings to you!
You can use the below query for custom objects:
Suppose, I have Book__c parent object and Test__c child object. I have created a lookup relationship (or master-detail) in Test__c with the name BookMaster__c. I can use the below query to fetch the parent records with no child records:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
What is exactly query you are using can you please provide because I have checked with the same query as used for standard object, it is working fine.
Let Class__c is ParentObject and Student__c is Child object.
Please try this query: I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi