Assigning a Query Selection with more that one field

rolguin

Member
Hi,

Can anyone give a help on this what am I doing as wrong, please?

This assignment does not make any effect - The Query keeps showing all records of the table.

/***************************************************************/
DEF VAR c-fieldname AS CHAR NO-UNDO.
DEF VAR c-value AS CHAR NO-UNDO.


ASSIGN f-promno
f-pcode.

ASSIGN c-fieldname = "promot.prom-no:U,promot.p-code:U"
c-value = f-promno:SCREEN-VALUE + CHR(1) + f-pcode:SCREEN-VALUE + CHR(1).

IF f-promno:SCREEN-VALUE <> "" THEN DO:
DYNAMIC-FUNCTION('assignQuerySelection':U IN h_bwgo55-sdoprom,
c-fieldname,
c-value,"=":U).
END.
ELSE
DYNAMIC-FUNCTION('removeQuerySelection':U IN h_bwgo55-sdoprom,
"promot.prom-no","=").

DYNAMIC-FUNCTION('OpenQuery':U IN h_bwgo55-sdoprom).
/**********************************************************************/

Thanks in advance.
 

Stefan

Well-Known Member
I have no idea which framework you are using (adm2?, dynamics? - I have never used neither). What should you be passing to assignQuerySelection?

The following looks just wrong:

Code:
ASSIGN c-fieldname = "promot.prom-no:U,promot.p-code:U"

Shouldn't this be:

Code:
ASSIGN c-fieldname = "promot.prom-no,promot.p-code":U

If you pass multiple fields do you only need to provide one operator (=)?
 

RealHeavyDude

Well-Known Member
The :U is a character - not a field - qualifier. It's only usage is for the translation manager ( or your own internationalization solution ) to recognize strings that should not be translated, for example a character value ( a code ) that is internal to your business logic.

IMHO, it's good practice to use this qualifier to prepare an application for internationalization - but, as always, one must need to know how it does work.

Heavy Regards, RealHeavyDude.
 
Top