QUERY-PREPARE FOR STATIC BROWSE

fuji36

New Member
I have a simple Dialog form, with a single Browse.
The Query hits a couple of tables (ie: FOR EACH 'this', FIRST 'that',...).

I'm looking to capture the default 'PREPARE-STRING' attribute and store it in a variable.
I can see in Help that the 'Prepare-String' attribute will return '?' if the Query was Opened, with Open Query.

I'm assuming that a 'Query-Prepare' method fires off when the Dialog is opening, and it appears that I'll need
to grab my value before Open-Query' fires off.

Can anyone steer me in the right direction here? Is it even possible to grab that default Prepare-String value as a character ?
 

Osborne

Active Member
Has the form and browse been created with the AppBuilder, and if so does accessing the QUERY-STRING code the AppBuilder creates do what you want?:
Code:
prepareString = "{&QUERY-STRING-Browse1}".
Otherwise, just to be clear, when the dialog form is being run the browse is being opened using OPEN QUERY and you want to know the value before it is being opened? Does doing something like this help?:

When the dialog form runs assign the browse the query prepare string:
Code:
Browse1:QUERY:QUERY-PREPARE("FOR EACH 'this', FIRST 'that',...").
Once assigned like this you can now access the PREPARE-STRING value without opening the query first:
Code:
prepareString = Browse1:QUERY:PREPARE-STRING.
MESSAGE prepareString VIEW-AS ALERT-BOX.
Browse1:QUERY:QUERY-OPEN().
 

RealHeavyDude

Well-Known Member
You can grab the handle to any static query and work with the prepare-string attbiute.

assign prepareString = QUERY myQuery:handle:prepare-string.
 
Top