Hi all,
I'm doing a very simple query window. I can put the dw in query mode, but when I retrieve, my query parameters are ignored and nothing is returned.
Here's the code for the dw:
//Constructor
this.of_SetUpdateable( FALSE )
// First, enable the DW services...
this.of_SetRowSelect( TRUE ) // Row selection service
this.of_SetSort(TRUE) // Sort service
this.of_SetFilter( True ) // Filter Service
this.of_SetQueryMode( TRUE ) // Query Mode service
// Second, set the transaction objects...
this.of_SetTransObject(SQLCA)
// Third, Initialize the DW services
this.inv_rowselect.of_SetStyle( 0 )
this.inv_sort.of_SetColumnNameSource(0) // Use the column names for sorting
this.inv_Sort.of_SetColumnHeader( TRUE ) // Sort when user clicks column header
this.inv_Sort.of_SetStyle( 0 ) // PB's Drag/Drop Sort window
this.inv_Filter.of_SetStyle( 0 ) // PB's Filter window
Here's the code for the window open event:
string ls_querycols[]
ls_querycols[1] = "tmde_noun"
ls_querycols[2] = "tmde_model"
ls_querycols[3] = "tmde_mfr"
dw_1.inv_querymode.of_SetQueryCols( ls_querycols )
// Open in query mode
dw_1.inv_querymode.of_SetEnabled( TRUE )
Here's the code for the Retrieve button:
dw_1.inv_querymode.of_SetEnabled( FALSE )
And the code for the Query button:
dw_1.inv_querymode.of_SetEnabled( TRUE )
Seems pretty simple, but apparently I'm missing something. Any advice is sincerely appreciated.
~~~Tracy
Please consider separating your commands. While in-line code, like "RETURN this.Retrieve()" minimizes the space required for the code, it maximizes the difficulty if you ever need to debug.
I much prefer using separate lines of code, like this:
ll_rowcount = this.Retrieve()
RETURN ll_rowcount
This way you can put a breakpoint on the line of code that does the actual work easily, if required.
Coding in this manner does not decrease performance because the platform still has to do every step listed.
Remember that 80% of your time will be spent in maintenance, not development.