Solved

Concatinating old value and new value for modified columns.

Posted on 2006-06-15
2
369 Views
Last Modified: 2013-12-26
We have 10 detail rows in detail window. If the user double clicks one particular row then it opens the response window with all the 15 columns. So he can modify any values of 15 columns. Once he finished that then he press ok button. So the response window is automatically closed and the modified column/s value/s displayed on the detail window.
Right now the existing program is doing as
Suppose he double clicks on one row and does some modifications out of 15 columns and press ok button, it automatically closed and modified that particular row.
Let’s say he did modifications on two rows out of 10 rows. The existing program is passing 2 rows { ls_uc_row [1]  , ls_uc_row [2] } to update procedure, the remaining values {{ ls_uc_row [3]  , ls_uc_row [4]…ls_uc_row [10]  }are spaces.
Each row like ls_uc_row [1]  { ls_field[1] + ls_field[2] + …. + ls_field[15] }

I need to do find the old value and new value for modified values as well as description of that particular column out of 15 columns. So each modified row I need to add modified fields as [column_desc(char20)+old_value(char10)+new_value(char10)]. If he modified 4 columns out of 15, I need to add 4 more fields for the particular row like the above format.

Thanks for your advance help.
0
Comment
Question by:venkat4sv
2 Comments
 
LVL 6

Accepted Solution

by:
tr1l0b1t earned 125 total points
ID: 16913320
Hi,

Assuming you'd like to fill 'ls_uc_row' array with dw_1 changes ...

String ls_uc_row[]
Long ll_idx = 1

String ls_format, ls_old, ls_new, ls_colname
Long ll_col, ll_cols, ll_row, ll_rows

ll_rows = dw_1.RowCount()      // Nº of rows should be always 1
ll_cols = Long(dw_1.Describe("DataWindow.Column.Count"))

For ll_row = 1 To ll_rows
     For ll_col = 1 to ll_cols
          If dw_1.GetItemStatus(ll_row, ll_col, Primary!) = DataModified! Then
               ls_colname = dw_1.Describe("#" + String(ll_col) + ".name")
               // We'll get the data in same format as defined in dw
               ls_format = dw_1.GetFormat(ll_col)
               // Get old and new values
               ls_old = String(dw_1.Object.Data.Primary.Original[ll_row, ll_col], ls_format)
               ls_new = String(dw_1.Object.Data.Primary.Current[ll_row, ll_col], ls_format)
               // Fill in the array and right pad values with spaces
               ls_uc_row[ll_idx] = ls_colname + Fill(" ", 20 - Len(ls_colname)) + &
                                            ls_old + Fill(" ", 10 - Len(ls_old)) + &
                                            ls_new + Fill(" ", 10 - Len(ls_new))
               ll_idx ++
          End If
     Next
Next

Hope it helps
Regards
0
 

Author Comment

by:venkat4sv
ID: 16920397
But I’m not getting proper values.
We have One window(w_master) and two datawindows (dw_1 & dw_2) with in the window. The second dw has detail rows. The maximum detail rows are 10 and each one has 15 columns. If we click one particular row it will open one response window with previous values. Here we are changing the value/s and click ok then it closes automatically and goes to our first window(w_master) with modified value/s in detail row. When we hit save button on first window they are passing only changed rows (15columns) as an array type to update procedure. I need to add modified columns at the end of each modified row like desc+prev_value+new_value.
Thanks for your help.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question