You need to sign in to do that
Don't have an account?
Adam Cadam
SOQL query with IN clause and a List
How do you create a SOQL query using a filed name from a List of custom objects. I tried this but it doesn't work:
'orders' is a List<CustomApexObject> where CustomApexObject is just what it says, and it has a field called customerOrderCode, which contains a valid 'Order' Id,
The code above fails because customerOrderCode is a field on the CustomApexObject, not on the List<CustomApexObject>
Thanks!
List<Payment__c> payments = [SELECT Id,Name,Order__c,Settled_Date__c,Success_Date__c FROM Payment__c WHERE Order__c IN :orders.customerOrderCode];
'orders' is a List<CustomApexObject> where CustomApexObject is just what it says, and it has a field called customerOrderCode, which contains a valid 'Order' Id,
The code above fails because customerOrderCode is a field on the CustomApexObject, not on the List<CustomApexObject>
Thanks!
All Answers
Oh for C# with LINQ and Lamdas!