1. Joe Hess
  2. PowerBuilder
  3. Thursday, 25 July 2019 19:29 PM UTC

I have a typical master/detail layout in a window where the master datawindow is free form and the detail is a grid. The master datawindow will often have multiple rows with a single row visible at a time. If the user tries to change the active row in the master without saving, I throw up a prompt with an option to discard the changes.

What is the best way to discard changes to the current row that has a status of datamodified? In the past, I have used reselectrow(). That seems to be causing problems in PB2019. The row always returns back to row 1.

Hope that makes sense,

Joe

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 25 July 2019 19:36 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Joe;

  Yes, a ReSelectRow (RowNum) command should reset the row & column flags in the DWO's primary buffer. If this does cause a run-time issue - please open a support ticket.

  Another fast way to reset one row's flags is to copy the row data from the "Original" buffer to the current Primary buffer.

Regards ... Chris

Comment
  1. Joe Hess
  2. Friday, 26 July 2019 11:03 AM UTC
Thanks, Chris. I will dive into the code a little more to see if there is not something else causing the problem before I open a support ticket. The same code in PB9 does not jump back to row 1 which does not say much. I've seen a few things work in PB9 that should not have :)



Joe
  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Friday, 26 July 2019 10:22 AM UTC
  2. PowerBuilder
  3. # 1

Hi Joe,

If you know that only current row has been modified, then I would copy row content from Original buffer, then call ResetUpdate( ) to ensure all flags are back to NotModified!

Copy from Original vs. ReselectRow

Original contains the originally retrieved data whereas ReselectRow performs a new retrieve. Data may have changed in database. I use ReselectRow to refresh data when update fails due to "Row changed between retrieve and update."

HTH /Michael

Comment
  1. Joe Hess
  2. Friday, 26 July 2019 11:05 AM UTC
Thanks, Michael. Copying the original makes better performance sense to me.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.