Hi everybody
I am having a problem I don't really understand.
I have a cWebGrid which is throwing the following error every time I try to change to a new row:
Code:
Assert: Server DDO's current record does not match psCurrentRowId
DataFlex Error#: 4402 in line: 26611.
There doesn't seem to be anything very special about the Grid. The same overall logic works in the Windows version. If I convert it to a cWebList (not actually a viable solution, BTW - I need it to enter data) there is no problem.
The grid's Server is set to a child DDO, while all of the Entry_Items are on a (non-constraining) parent table of that DDO - there is another (constraining) parent. The actual error is happening in AllowChangeSelectedRow in the cWebGrid.pkg (line 307), which is why there is no problem in a cWebList - in that AllowChangeSelectedRow just returns True; not so with the grid.
The problem is that the list's Server object does not seem to have a current RowID.
The following code in the object seems to fix the problem (by brute-forcing the Grid's server to have the correct row loaded before it hits the assertion in AllowChangeSelectedRow), but I'm worried that it might really just be hiding it, not actually solving it:
Code:
Function ChangeCurrentRow String sGotoRow String sToRowID Returns Boolean
String sRowID
RowID riRowId riD
Boolean bOK
Handle hoServer
WebGet psCurrentRowId to sRowID
Move (DeserializeRowID(sRowID)) to riRowId
Get Server to hoServer
Get CurrentRowId of hoServer to riDD // This is always empty
If not (IsSameRowID(riRowId, riDD)) ;
Send FindByRowId of hoServer (Main_File(hoServer)) riRowID
Forward Get ChangeCurrentRow sGotoRow sToRowID to bOK
Function_Return bOK
End_Function
If I comment-out the lines in blue, the error occurs and navigating off the row fails; with them in, it works.
And before you ask the obvious question: "Could it be to do with the DDO structure?"... the answer it "Yes, I am afraid it could" - there are almost 60 involved (so as complicated as all whatever!), but that structure is (AFAIK) identical to the one in the (working) Windows version (I copied it).
Anybody have an idea what might be wrong and why/how it could be happening?
Mike
(PS - v19.1.58)