Hi all,
I have a set of 4 tables, OrdersCP, Consumable Products, Consumable Packages and Packages. The use case is as follows:
I have actions defined to do #4 in tables Orders, and PkgItems and it works fine if there is 1 PkgItem in an order but it doesnโt work when there are 2 or more PkgItems in an Order.
The action chain doesnโt seem to process the PkgItems in sequence and creates more lines in Consumable Products than needed.
Here are the actions and some details I have set up.
Action Add Package Items
Action Add to CP Order: loop
Action Add to CP Order: add item
Action Add to CP Order: incr copied
Action Add to CP Order: repeat
This seems like a bug but maybe there is a different way to set it up. I think the repeat action is the culprit but I am not sure.
@Steve @Aleksi @Phil - any suggestions?
Thanks.
Solved! Go to Solution.
Iโm still not quite understanding the data hierarchy, and exactly which data is used to create the records.
One way that Iโve converted an โexecuteโฆโ action, in order to make it run in serial, is as follows.
Child records in this case already each had a sequence number (1,2,3,4โฆ) for them to be run in. I then added a Y/N Type [Complete?] column to each.
The Parent record had an โexecuteโฆโ action, which ran the Childโs action, but only on the single record that matched
MINROW( โchildโ , โsequence numberโ , NOT( [Complete?] ) )
The Childโs action was a group of 3 actions.
I donโt understand what the loop is for? Since youโve already specified the action to run on all related Consumable Packages. Seems to me like that would create n^2 number of records, instead of n. Maybe I misinterpreted though?
The loop is for copying n items (of Consumable Products) from Consumable Packages to Consumable Products. So, say Pkg1 has 2 items and Pkg2 has 3 items, I need 5 rows in Consumable Products.
Ideally I would like to set it up so that rows in Consumable Packages are processed in sequence (so, Pkg1-Item1, Pk1-Item2, Pkg2-Item1, Pkg2-Item2, Pkg2-Item3) but what I see happening is that it doesnโt. It seems to be doing Pkg1-Item1, Pkg2-Item2, Pkg1-Item2 etc.
Well I can at least respond to that. โExecute an action on a set of recordsโ does NOT execute in serial order. See the following thread
Clarification: Does Consumable Packages have an EnumList column where the products are selected, and then you want those to be converted to Consumable Product records?
Thanks for that link to the other thread.
Orders CP has child records of Consumable Packages which are Packages so yes, there is a List of Consumable Packages that each member of the List needs to be processed one after another. I think I need to add a looping variable for that in the actions but not sure where and how.
I have logic for controlling the inner loop but not the outer loop, if that makes sense.
Iโm still not quite understanding the data hierarchy, and exactly which data is used to create the records.
One way that Iโve converted an โexecuteโฆโ action, in order to make it run in serial, is as follows.
Child records in this case already each had a sequence number (1,2,3,4โฆ) for them to be run in. I then added a Y/N Type [Complete?] column to each.
The Parent record had an โexecuteโฆโ action, which ran the Childโs action, but only on the single record that matched
MINROW( โchildโ , โsequence numberโ , NOT( [Complete?] ) )
The Childโs action was a group of 3 actions.
Cool, thanks @Marc_Dillon. This will work for me, I think. Let me try.
User | Count |
---|---|
43 | |
28 | |
24 | |
24 | |
13 |