Are you sure you're triggering a new line before starting to SetValue / Write... within the loop?
retVal = oLines.AddLine()
It could be that the line is not being dropped, and it is simply being overwritten with new values (so it only seems like it is being dropped).
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
------------------------------
Original Message:
Sent: 12-15-2020 12:56
From: Bastian Boesner-Worth
Subject: UI Script drops first (unsaved line) from Sales Order
I had that in my script and then took it out for testing. Unfortunately, it doesn't make a difference. If I set key back to what it was or not, doesn't make a difference.
Is there a method to save all uncommitted lines first?
------------------------------
Bastian Boesner-Worth
Regional Consulting Manager
SWK Technologies Inc.
East Hanover NJ
973-396-1721
------------------------------
Original Message:
Sent: 12-15-2020 10:58
From: Kevin Moyes
Subject: UI Script drops first (unsaved line) from Sales Order
I used this once to fix the UI falling out of line with the Lines object in a UI script.
sLoadKey = ""
sLoadKey = oLines.GetKey()
...
if sLoadKey<>"" Then
retVal = oLines.SetKey(sLoadKey)
End If
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
Original Message:
Sent: 12-15-2020 10:45
From: Bastian Boesner-Worth
Subject: UI Script drops first (unsaved line) from Sales Order
It actually drops the line. I think moving around in the lines object messes up the proper focus. In the UI it shows correctly, but then once you go to the TotalsTab and back, it's gone.
------------------------------
Bastian Boesner-Worth
Regional Consulting Manager
SWK Technologies Inc.
East Hanover NJ
973-396-1721
Original Message:
Sent: 12-15-2020 10:08
From: Kevin Moyes
Subject: UI Script drops first (unsaved line) from Sales Order
Does the script actually drop the lines, or does it just not show them in the UI? If it's just display, there is a button script refresh idea you could try.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON