I have been trying to learn a bit of Application Studio. We Backflush the majority of our materials for our main production (don’t start) so therefore the majority of our parts are set to backflush. However, when we create spares jobs they have the ability to be made on a variety of benches are a brought out as a kit because a lot of these spares are for assembly variants or component assemblies that aren’t currently being produced through our main lines. A knock on of this is that to perform the spares job kitting process our jobs for these need every material unticked for backflush manually. I know in future state I could probably use a BPM that recognises a spare job and turns backflush off or we might move away towards backflush entirely. However, for the time being I want the quick win for our production team leader to just turn off the backflush flag for all the materials in a job. Currently I have a button that fires and iterates through the materials and removes the backflush flag for seemingly every other row. Below are the steps I have taken with my info toasts removed.
I was able to replicate the error you were having. Seems odd, but I did find a work-around that will get you the end result you’d like, if you’d like to keep the customization on the application studio layer. As Jose said, it’s recommended to do anything with data on the backend though.
Explanation - When I looked at the debug logs (you can see them by pressing using the hotkey ctrl+alt+8, then press F12 to open the dev tools), I saw that after the first half of the iterations, the “ColumnChanged_JobMtl_BackFlush” event stopped being called. It seems like a bug to me, and is the reason why only every other row is being updated, as you mentioned.
This solution essentially makes the “dataview-condition” act as a while loop.
Step 1 - On click of the button, call the “dataview-condition”. This needs to be its own event, because we will use it in step 3.
Step 2 - Dataview condition. This is called from step 1, and will use our “helper” in step 3 to update the rows.
Step 3 - Update the rows. Once the rows are updated, call the step 2 event containing the dataview condition again. This will check to see if there are any matches remaining, then send them to step 3 again. This will continue until there are no matches remaining.
As mentioned, this is just a work around. I would think using a function to do the same thing would achieve a cleaner outcome. However, if you are just looking for a quick win for the production team leader, this will get the job done.