Tuesday, April 2, 2019

How to filter the grid based on the control value in X++

Under data source Execute Query we can pass the Query range with the control value as mentioned below

public void executeQuery()
{
    this.query().dataSourceTable(tableNum(CICVendorCustomerCreation)).addRange(fieldNum(CICVendorCustomerCreation, CustomerCreated)).value(SysQuery::value(CustomerCreated.value()));
    super();
}

On control modified we can call the data source execute query as mentioned below

public boolean modified()
{
    boolean ret;
    CICVendorCustomerCreation_DS.query().dataSourceTable(tableNum(CICVendorCustomerCreation)).clearRanges();
    CICVendorCustomerCreation_DS.executeQuery();
    ret = super();
    return ret;
}

No comments:

Post a Comment

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// &l...