1. lingaiah T
  2. PowerBuilder
  3. Monday, 22 March 2021 14:00 PM UTC

Dear Team,

Is there any way to export Json data from Datawindow Original values from Modified rows?

PB 2019.

Datawindow

 

Col 1               Col2                      Buffer                   RowStatus

----------------------------------------------------------------------------------------

EmpA              Emlpoyee A         Primary             Not Modified

EmpB              Emlpoyee B         Primary             Not Modified

---------------------------------------------------------------------------------------

 

I was changed col2 From : Employee B  to Employee Bnew   

 

When Export Json, I want to Employee B  instead of Employee Bnew    (i.e Original value) 

or Any suggetioins please.

thanks in advance.

 

John Fauss Accepted Answer Pending Moderation
  1. Monday, 22 March 2021 15:29 PM UTC
  2. PowerBuilder
  3. # 1

You can create a DataStore, assign to it the same DataObject, then use RowsCopy to copy the desired row(s) from the DataWindow's Original data buffer to the DataStore, and then export the data from the DataStore to JSON.

Comment
  1. Chris Pollach @Appeon
  2. Monday, 22 March 2021 19:15 PM UTC
Hi John ... lingaiah - I agree with john that this is probably the best route route to get exactly what you want export data wise..
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Monday, 22 March 2021 14:24 PM UTC
  2. PowerBuilder
  3. # 2

Yes, but you have to do it one row at a time.  You should use ExportRowAsJson function.  Here is the PB 2019 R3 doc, but it is the same in 2019 R2 and 2019: https://docs.appeon.com/pb2019r3/datawindow_reference/ch09s30.html

 

Comment
  1. lingaiah T
  2. Monday, 22 March 2021 14:51 PM UTC
If anycolumn modified in the row, I want to track what it was original value and changed. Example: price was changed 80 to 90. I want to log this price 80
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Monday, 22 March 2021 14:53 PM UTC
You will have to write some code to get what you want.
  1. Helpful
  1. Roland Smith
  2. Monday, 22 March 2021 15:02 PM UTC
Export the JSON to an instance variable right after the retrieve.
  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.