1

How I can achieve below code using flows:

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'];

Set<String> myIds = new Set<String>();                                                      
for (AcctSeedERP__Outbound_Inventory_Movement__c  tfr : tfrs) {
    myIds.add(tfr.Warehouse_To_and_Product_ID__c); 
}    

List<Par_Level__c> parLevelsNeedingStock = [
    SELECT ID
    FROM  Par_Level__c 
    WHERE Unique_Id_For_Warehouse_Product__c NOT IN : myIds
    AND Difference_From_Par__c < 0
    AND Warehouse_Category__c = 'Consignment'];

And How Can I use "parLevelsNeedingStock " List in next for loop. I tried but i am getting confused where to close first for loop and how to start next for loop.

1 Answer 1

0

You can create the list of ids/Objects as a variable resource in the flow.

In the Flow Builder -> Toolbox -> Manager -> click 'New Resource' button. Which will open a dialog like below:

enter image description here

From there:

  • Select Resource Type as Variable
  • Choose the API name
  • Select Data Type as Text in case of Id.(SObjects and other datatype are supported too).
  • Check the box = Allow multiple values (collection)
  • Check the Availability checkbox as required.

You can use the same variable in the loop logic. Flow Documentation

1
  • 1
    Hey Rahul Thanks.
    – jsmith
    Aug 6, 2019 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.