You need to sign in to do that
Don't have an account?
Phuc Nguyen 18
Subquery filter not working
Hello ALl,
I have a controller for a VF page where I am returing fileds from a parent and multiple child records.
Here is the code in the controller
The issue I am having is that the criteria for the Customer__r is not working. If I have 3 customer and 2 of them have an invoice I want only 1 record returned but Instead I get all 3.
Thanks,
P
I have a controller for a VF page where I am returing fileds from a parent and multiple child records.
Here is the code in the controller
Accountres = [Select Id,(select Amount__c,Fee_Type__c,Invoice__c from Customer__r where Invoice__c = null) from Account where id=:acctId];
The issue I am having is that the criteria for the Customer__r is not working. If I have 3 customer and 2 of them have an invoice I want only 1 record returned but Instead I get all 3.
Thanks,
P
Did you mean "==" instead of "=" Try this query: Also you can use LIMIT 1 to limit number of records returned from child records. Hope this help! Please mark as best answer if it does.
Thanks