I have a dbAware webGrid that allows users to add / remove entrys via 2 buttons
The code is as below
Now the add works and the grid is refreshed with new entry as expected.
However on a remove the app throws an error
Now tracing through the refreshListFromDD it appears to work as expected and goes into the code block marked, which is correct as the record no longer exists
However the app then throws a record eq not found
I expect this to work as it does in a winapp with moveToFirstRow (even though client/server are only loosely connected on the web)
It seems to me that something is not correct in the client as it still attempts to find a record that is no longer in existence
Is this a bug or am I using this in a way not expected, and if so the help needs to explain the process for adding/deleting on the backemd through processes done not through direct user data entry.
Code:
procedure AddBooking
// setup code here
etc etc
Send Request_Save of Hdd
Send RefreshListFromDD of oDetailGrid
End_Procedure
Procedure RemoveBooking
Handle hDD
Move oEnFuture_DD to hDD
Send Request_Delete of hDD
Send RefreshListFromDD of oDetailGrid <---------- causes an error (record not found eq)
End_Procedure
Code:
Procedure RefreshListFromDD
Handle hoDD
RowID riId
Integer iMain
Boolean bDataAware bFound
Get pbDataAware to bDataAware
If bDataAware Begin
Get Server to hoDD
Get Main_File of hoDD to iMain
Get CurrentRowId of hoDD to riId
If (IsNullRowID(riId)) Begin
Send MoveToFirstRow
End
Else Begin
// test to see if the record still exists
Move (FindByRowID(iMain,riId)) to bFound
If bFound Begin
Send FindByRowId of hoDD iMain riId
End
Else Begin
// no record, we don't know what to do. Just go to the top
Send MoveToFirstRow <---------------------------end here which is correct
End
End
End
End_Procedure