Hi,
Since you are doing the code in the ItemChanged() event, you are trying to modify the status of things while they still are being modified. Try doing this after the ItemChanged() has finished:
if dwo.name = 'check_yn' then
This.POST SetItemStatus(row, 0, Primary!, NotModified!)
end if
Also, for some crazy reason, when doing SetItemStatus(), you may have to do more than one call to that function to achieve the final status you want. I don't know why things can't be easier, but it's the way it is.
In the powerbuilder 12.6 help on SetItemStatus() there's this table (the table in the help of pb2017 is a bit clearer):
Table 9-9: Effect of changing from one row status to another
Original status
|
Specified status
|
|
|
|
—
|
New!
|
New Modified!
|
Data Modified!
|
Not Modified!
|
New!
|
-
|
Yes
|
Yes
|
No
|
NewModified!
|
No
|
-
|
Yes
|
New!
|
DataModified!
|
NewModified!
|
Yes
|
-
|
Yes
|
NotModified!
|
Yes
|
Yes
|
Yes
|
-
|
|
|
|
|
|
For exampe, it shows that if you want to change a status of NewModified! to NotModified!, the result will be New!
If your initial status is NewModified!, than you do this to get a status of NotModfied!:
First:
This.POST SetItemStatus(row, 0, Primary!, DataModified!) // resulting status will be DataModified!
and after that:
This.POST SetItemStatus(row, 0, Primary!, NotModified!) // resulting status will be NotModified!
Anyway, instead of using SetItemStatus() an easier way to achieve what you want is doing this:
This.POST ResetUpdate() // resulting status of all rows will be NotModified!
(but only if you want ALL rows to have itemstatus NotModified!)
regards
I just added "POST", then it works well.
Thank you again.