Hi all,
Another strange one. I've got a window with a dw on it, inherited from PFC u_dw. I've got code for the dw that has 3 user events. ue_cut_rows, ue_copy_rows, ue_paste_rows.
I can cut/copy rows, then paste rows, works fine. But, when I save the dw, I get a dw error:
If I then close the window, then reopen the window, the dw did indeed save the dw with the correct cal_points.id value. So why am I getting the error in the first place?
I copied all code from the last version of my software. It works as expected in that version. Previous version was PB2019 R3 Build 2728 (not sure of PFC version). I am currently using PB2021 Build 1509, PFC 12.
Here's the code I've got for the pfc_preupdate event... I've tried putting this in the pfc_update event instead... same result.
// Over-ride ancestor...
long ll_NewRows, ll_CalPointID, ll_ThisRow, ll_RowCount
// Assign ID#'s for new rows...
ll_RowCount = this.RowCount()
if ll_RowCount > 0 then
ll_NewRows = this.GetItemNumber( ll_RowCount, "cf_nullrows" )
MessageBox("Null IDs", ll_NewRows)
if ll_NewRows > 0 then
ll_CalPointID = f_get_calpoint_id ( ll_NewRows )
if ll_CalPointID <= 0 then return -1
ll_ThisRow = this.Find("IsNull(id)", 1, ll_RowCount)
MessageBox("First Null Row", ll_ThisRow)
DO WHILE ll_ThisRow > 0
this.SetItem( ll_ThisRow, "id", ll_CalPointID )
MessageBox("ID", "Row: " + string(ll_ThisRow) + " ID: " + string(ll_CalPointID))
ll_CalPointID++
ll_ThisRow = this.Find("IsNull(id)",ll_ThisRow, ll_RowCount)
LOOP
end if
end if
return 1
The MessageBox's are only there for trouble-shooting... all values are correct, every time. cf_nulls is a computed field on the dw, summary band.
This application is already in production with a couple customers, so it's a report bug.
TIA,
~~~Tracy
Well done!
MessageBox("Database Error", this.ClassName())
Pops up an extra messagebox, but that's ok. Shouldn't happen very often!