The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
Adds a table field to the filter control for a table on the filter page.
[Ok :=] FilterPageBuilder.ADDFIELDNO(ItemName, FieldNo[,Filter])
The name that is assigned to the table in the filter control. This value must match the value of the ItemName parameter that was specified by ADDTABLE, ADDRECORD, or ADDRECORDREF method that adds the table to the filter control.
The number that is assigned to the field in the table as specified by the Field No. Property.
A default filter on the field that is specified by the Field parameter.
True if the field was added to the field list for the specified filter control; otherwise, false.
The filter control that is specified by ItemName must already exist in the FilterPageBuilder object before the ADDFIELDNO method is called. This means that either the ADDTABLE, ADDRECORD, or ADDRECORDREF methods must be called before the ADDFIELD method.
If the filter page implementation will call a SETVIEW method, then the SETVIEW method must be called before the ADDFIELDNO method call, otherwise the default filter that is specified by the Filter parameter for field, if any, will be cleared by SETVIEW.
The filter that is specified by the Filter parameter will overwrite any previously defined filters for the field which were set by ADDVIEW method or read from the record or recordRef instance that defined the filter control.
The following example initializes a filter page object that includes a filter control for the Date system table. The filter control has the caption of Date record. The example adds two fields of the Date record variable which will be available in the filter control on the filter page: Period End and Period Start. A default filter is set on the Period End field.
This example requires that you create the following global variables.
varDateItem := 'Date record'; varFilterPageBuilder.ADDRECORD(varDateItem, varDateRecord); varFilterPageBuilder.ADDFIELDNO(varDateItem, varDateRecord.FIELDNO(varDateRecord."Period End"),'03032014D'); varFilterPageBuilder.ADDFIELDNO=(varDateItem, varDateRecord.FIELDNO(varDateRecord."Period Start"));
GETVIEW Method (FilterPageBuilder)
COUNT Method (FilterPageBuilder)
NAME Method (FilterPageBuilder)
RUNMODAL Method (FilterPageBuilder)