You need to sign in to do that
Don't have an account?
Danny Hartley
SOQL Query against Apex List Variable
Hello,
I am wondering if it is possible to filter a List of records based on a text field from another Apex List Variable. I would like the variable parLevelsNeedingStock to grab Par Level records where the field 'Unique_Id_For_Warehouse_Product__c' is not in any of the records from the Apex List<> variable 'tfrs'. Thanks in advance for any help.
I am wondering if it is possible to filter a List of records based on a text field from another Apex List Variable. I would like the variable parLevelsNeedingStock to grab Par Level records where the field 'Unique_Id_For_Warehouse_Product__c' is not in any of the records from the Apex List<> variable 'tfrs'. Thanks in advance for any help.
AcctSeedERP__Outbound_Inventory_Movement__c[] tfrs = [SELECT Id, Warehouse_To__c, AcctSeedERP__Warehouse__c, AcctSeedERP__Product__c, Lot__c, Warehouse_To_and_Product_ID__c FROM AcctSeedERP__Outbound_Inventory_Movement__c WHERE Inventory_Transfer__r.Warehouse_To__r.Category__c = 'Consignment' AND Inventory_Transfer__r.Transfer_Shipped__c = False AND AcctSeedERP__Type__c = 'Transfer']; List<Par_Level__c> parLevelsNeedingStock = [SELECT ID FROM Par_Level__c WHERE Unique_Id_For_Warehouse_Product__c NOT IN : tfrs AND Difference_From_Par__c < 0 AND Warehouse_Category__c = 'Consignment' ];
Alain
All Answers
Alain
What I need to do is: I have a custom object (choices__c) where I'm building a VFP within it. In this VFP I have to query data from another custom object (products__c). I just can't query the data. After that I'll still have to put it in a dropdown list in order for the client to choose the products and start adding it to order.
Can you guys give me some hints?
See below my VF page:
See below my choice controller:
So, my list is working fine. When I changed it for the 2 lines in line 6 and 7 in order to query the data in put in the list, I can't get done.
String querychoices = 'SELECT Name From Product__c';
List<Product__c> choices = Database.query(querychoices);
In line 9 below, I get the error: Invalid loop variable type expected product__c was String
I need to query this data from sObject (product__c, especifically its names) and insert them into a droplist button in visualforce page, but I can't seem to figure out my controller issue.