App Studio - Check for dirty row and invoke update

Kinetic 2025.2 on-prem.

I’ve got a button on the Lines Detail tab in Customer Shipment Entry. The button invokes a function which is fairly complicated, but as part of the logic it reads the ShipDtl table, including the row that’s being updated. The problem I’m having is if the user has changed data on ShipDtl, but has not clicked SAVE, what’s on the screen and what’s in the database are NOT the same, and I’m getting inaccurate data.

I thought I could put a condition at the front of my button click logic with a condition basically ShipDtl.RowMod = “” - if it’s false then I’d have to commit the change to the database. I believe that means I’ll need to make a REST call (couldn’t find that in this help system, but I know I saw it). However, that condition is not working. When I look at the ShipDtl dataview from application studio, I don’t see a RowMod field as part of the dataview.

I suppose I could call the update every time the button is pressed, but I would think that’s overhead that I don’t necessarily need to do.

Any thought?

Event-next →SysUpdate
Yes if you are calling a function that requires current data then you have to do this before you call the function.

The alternative is pass all needed data from the UI to the function instead of doing a db read.

1 Like

RowMod doesn’t exist IN the “dataview” in app studio, but it does still exist. If you look in debugger, it does show:

Here’s a row I added just by clicking the “new” icon.

Here’s a row that was closed and I reopened, and the RowMod displays as “U”

It could just be the syntax in your condition??

Perhaps you can tap into existing events. There is one called PerformUpdate. The first action in this event is to call an event called Dataset_hasChanges. That event has a condition of: %dataset.CustShip.hasChanges% === true

If that’s true, then it goes through the update process.

I’m wondering if you can call PerformUpdate prior to your function call. That might get your through the whole “dirty-row” stage and save the data to the server, if required, prior to your function.

3 Likes