QueryParameter
The QueryParameter is used in conjunction with Query object and QueryParametersView control. When a query requires some parameters in 'where' clause to be entered via user interface (QueryParametersView), we will use QueryParameter instead of where clause value. When QueryParametersView is initialized with such a query, it will show matching editors to fill in those values. See example below.
Constructor:
constructor( name: string | Field, value?: any, values?: AttributeValue[] | ()=> AttributeValue[] )
Creates a new QueryParameter instance.name: string | Field
Defines the label shown in the QueryParametersView. It can be a text or a field object like Contract.amount.value: any
Will be the initial value for the specified field shown in control QueryParametersView.value: AttributeValue[] | ()=> AttributeValue[]
Used to limit possible values selection. It is an array of AttributeValue objects or a getter func returning an array of AttributeValue objects.
Example
this.queryMask = new QueryParametersView(this);
this.queryMask.source = await Contract.
where(Contract.amount,
WhereOperator.Equal,
new QueryParameter(Contract.amount, 100000)).and
where(Contract.party,
WhereOperator.equal,
new QueryParameter('Party name', '')).
where(Contract.status, WhereOperator.equal, 'open').
selectAsync();