Application Studio - Job Entry Layer - Remove BackFlush from All Materials

Hello All,

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 created a button on the Materials Grid.


I used On Click as the Hook



JobMtl is my DataView

The Iterative Event is a user defined row update

No trigger/hook for the event

The row update attempts to match with the results and set the value to false

When I fire the button on the preview I typically get every other row

However in one job I attempted it also included the last row after going every other.

Any guidance would be greatly appreciated.
Regards,
Mack

This is one of those scenarios where back end is the right answer.

Have the button call a function on the function do work then refresh the screen

5 Likes

Could be wrong but your row-update may want to set JobMtl.Backflush to false where MtlSeq = matches.MtlSeq and possibly also JobMtl.RowMod = “U”

Nevermind you’re doing it right, still may want to also set matches.RowMod = “U” and save.

If you want to inspect some out-of-the-box iterators, take a look at Erp.UI.InspResultsEntry app.

1 Like

Hello Mack,
Hope you’re doing well.

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.

Here are the steps to get the solution you need:

1 -

2 -

2a -

3 -

3a -

Before:

After:

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.

Let me know if you have any questions~

Some additional resources:

2 Likes