1. Ivan Aase
  2. PowerBuilder
  3. Monday, 9 October 2023 12:56 PM UTC

Hi,

When using Datawindow function GetNextModified om Primary buffer I get all rows in return.

Is there something missing in my code ? while the buffer hold 5 rows and I change data in to there still is delivered 5 rows in loop.

 

Code example :

dwbuffer ldw_buffer
long l_row

ldw_buffer = Primary!

l_row = pdw_standard.GetNextModified ( 0, ldw_buffer )
do while l_row > 0
    // do the update from row..
    l_row = pdw_standard.f_nextmodifiedrow( l_row, ldw_buffer )
loop

 

return 0

 

 

 

mike S Accepted Answer Pending Moderation
  1. Tuesday, 10 October 2023 13:54 PM UTC
  2. PowerBuilder
  3. # 1

why do you think that all the rows are not modified?  did you check the status of each row?

Comment
  1. Ivan Aase
  2. Tuesday, 10 October 2023 17:12 PM UTC
Thanks, should have thought of this myself :-(

It turned out that the data window was updated with its own field when reading in, and with that, of course, all rows were set with the status not updated.
  1. Helpful
There are no comments made yet.
Christopher Craft Accepted Answer Pending Moderation
  1. Monday, 9 October 2023 15:53 PM UTC
  2. PowerBuilder
  3. # 2

Ivan,

Hard to tell from your code because you are calling a user defined function ( f_nextmodifedrow() ) which is probably where your issue is.

I can only guess from your commented line that your function is using the modified row to do an update but maybe that logic is causing the problem.  I would comment out that code and use l_row = GetNextModifie(l_row, Primary!) just to test the call itself.

l_row = pdw_standard.GetNextModified ( 0, ldw_buffer )
do while l_row > 0
    l_row = pdw_standard.GetNextModified ( 0, ldw_buffer )
    MessageBox("Testing", "Modified Row: + String(l_row))
loop

 

Chris Craft

Comment
  1. Ivan Aase
  2. Tuesday, 10 October 2023 06:25 AM UTC
Sorry, My mistake.

Yes we are using one userdefined function by default, but I already has change to PB internal without this having changed behaviour.



dwbuffer ldw_buffer

long l_row



ldw_buffer = Primary!



l_row = pdw_standard.GetNextModified ( 0, ldw_buffer )

do while l_row > 0

// do the update from row..

l_row = pdw_standard.GetNextModified( l_row, ldw_buffer )

loop

return 0
  1. Helpful
  1. Arnd Schmidt
  2. Tuesday, 10 October 2023 10:16 AM UTC
You can check the number of modified rows before the loop.



long ll_modifiedCount

ll_modifiedCount = pdw_standard.ModifiedCount()



https://docs.appeon.com/pb2022/datawindow_reference/dwmeth_ModifiedCount.html



hth

Arnd
  1. Helpful 1
There are no comments made yet.
Ivan Aase Accepted Answer Pending Moderation
  1. Monday, 9 October 2023 13:01 PM UTC
  2. PowerBuilder
  3. # 3

I am using pb 2022, build 1900

Comment
There are no comments made yet.
Konstantin Goldobin Accepted Answer Pending Moderation
  1. Monday, 9 October 2023 15:40 PM UTC
  2. PowerBuilder
  3. # 4

Hi,

Any chance there's something off in your f_nextmodifiedrow()?

Best regards,
Konstantin

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 10 October 2023 13:36 PM UTC
  2. PowerBuilder
  3. # 5

Hi, Ivan - 

Please also recognize that the GetNextModified() function not only finds existing rows containing information that has changed (row status = DataModified), but it also finds and reports on new rows that have changed (row status = NewModified). The ModifiedCount() function returns the total number of rows with either row status.

Best regards, John

Comment
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.