User Tools

Site Tools


additem_add_field_to_query_.htm
Navigation:  ABC Library Reference > QueryClass > QueryClass Methods >====== AddItem (add field to query) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

AddItem( name, title [ ,picture ] )

blk2blue.jpg

AddItem Adds specific functionality to the QueryClass.
name A string constant, variable, EQUATE, or expression containing the queryable item, typically the fully qualified name of a field in the view being queried.Tip: This may also be an expression such as UPPER(field1) or field1 * field2.
title A string constant, variable, EQUATE, or expression containing the text to associate with the queryable item. This text appears as the prompt or header for the item in the query dialog presented to the end user.
picture A string constant, variable, EQUATE, or expression containing the display picture for the queryable item. If omitted, picture defaults to S255 (unformatted string). See Picture Tokens in the Language Reference for more information.

The AddItem method adds a queryable item to the QueryClass object. The QueryClass object can then accept input for the item from the end user and build a filter expression to apply to the view being queried.

Other QueryClass methods, such as GetLimit and SetLimit, refer to the queryable item by its name.

TipBox.jpg

You may use the BrowseClass.UpdateQuery method in combination with the AddItem method to define a query interface that contains the BrowseClass fields plus other queryable items.

Example:

QueryForm  QueryFormClass

QueryVis   QueryFormVisual

BRW1     CLASS(BrowseClass)

Q         &CusQ

        END

CusWindow.Init PROCEDURE()

 CODE

!open files, views, window, etc.

 BRW1.UpdateQuery(QueryForm)                    !add browse fields to query

 QueryForm.AddItem('UPPER(CUS:NAME)','Name')    !add caseless name to query

 QueryForm.AddItem('CUS:ZIP_CODE','Name')       !add zip code to query

 QueryForm.AddItem('ITM:Qty+ITM:Price','Total') !add dynamic total to query

END

RETURN Level:Benign

See Also:     BrowseClass.UpdateQuery

additem_add_field_to_query_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1