Re: NewEra Supertables and GetChangeFlag()
Posted in 1996
Topics: Stored Procedures & SPL
Rick Schnabel wrote: > > I am using a supertable in free form style. I wanted to have the record apply if > the user leave the supertable, so I placed the following code in the AfterRow > event for the supertable: > > Variable > ok integer > > If superTable.getChangeFlag() <> superTable.isOriginal then > IF superTable.acceptRow() THEN > LET ok = superTable.applyRowSQL(superTable.getRowByNumber(displayMode : > ixSuperTable::displayData)) > END IF > end if > > After a lot of poking around I found that superTable.getChangeFlag() always > returned a zero even if data has been changed in the record. > > Two questions: First: Is the getChangeFlag supposed to change automaticly when > you change data in the supertable? Second: Is there a better way to accomplish > this? The following code segment works for me: -- Force validation of the current row CALL ST.acceptrow() RETURNING changed -- Check to see if any of the rows in the supertable have been -- modified. LET changed = FALSE FOR i = 1 TO ST.getnumstoredrows() FOR j = 1 to ST.getnumcols() IF ST.getchangeflag(i, j) <> ST.IsOriginal THEN LET changed = TRUE END IF END FOR END FOR The problem is that sometimes when a change is made to the contents of one superfield, and then the save button is clicked, the change flag is not correctly set for that superfield. Hope this helps. Mike