Solved

Datawindow Query

Posted on 2008-10-07
3
492 Views
Last Modified: 2013-12-26
Hi,

I have a datawindow control which i am using to assign different datawindow objects based on the selection of certain conditions. We have a AFC layer that contains objects specfic to our application which is basically inherited from the PFC layer. I have a function in one of the user objects defined in the AFC layer to format the sql's for all the datawindows dynamically based on the search condition selected by the users for each and every screen/report.
I want to perform an action based on the tag value of a column from a particular datawindow.  For ex.
lets assume we have datawindow  dw_1 which contains column1, colum2, column3.
I want to perform the following logic
If dw_1.object.column1.tag = 'OK' then
   <perform your check>
else if
   <do not perform your check>
End If.

this is a straight away method if i have only one datawindow control/object. In my case i need to get the column name of the appropriate datawindow object that is assigned to the datawindow control for a specific screen and then assign that column/control name to the command line 'dw_1.object.column1.tag ' to perfom the action i need. Can anybody shed me some light on how to go about this..

Please let me know if you need some more clarifications on my request.

Cheers
0
Comment
Question by:senmaddy
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 125 total points
Comment Utility
you can use getcolumn() and gecolumnname() function to get the column no/name from a datawindow and then use Describe function to get the property value instead of '.object 'notation.

See code snippet for example

Regards
Sandeep

e.g.

string ls_colname,ls_val

ls_colname = dw_1.GetColumnName()

ls_val = dw_1.Describ(ls_colname+".tag")

If ls_val = 'OK' Then

<process1>

Else

<process2>

End If
 

OR

string ls_colno,ls_val
 

ls_colno = string(dw_1.GetColumn())

ls_val = dw_1.Describ("#"+ls_colno+".tag")

If ls_val = 'OK' Then

<process1>

Else

<process2>

End If

Open in new window

0
 

Author Comment

by:senmaddy
Comment Utility
Hi Sandeep,

thanks for your hint. I could not get the column name in the user object function since only the base sql of the datawindow is passed to function as an string argument.  
Neverthless, i used describe method to satisfy my need as described below.

   ll_Poscolumn = Pos(ls_BeforeLike,".",1)
   ls_column_name = Trim(Mid(ls_BeforeLike,ll_Poscolumn+1))
//            ls_check_upper = idw_requestor.object.productcode.tag
   ls_check_upper = idw_requestor.Describe(ls_column_name+".tag")
   Messagebox('ls_check_upper',ls_check_upper)
      IF ls_check_upper <> 'NU' then
            <process1>
      ELSE
            <process2>
      END IF

Many thanks once again for your time on this issue.
0
 

Author Closing Comment

by:senmaddy
Comment Utility
Many Thanks
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now