Home

Tuesday, February 24, 2015

Query() and While Select in X++


We can use Query() class or while select statement to create a query on the table.

using while select statement

while select InventTable
ItemId == "123ABC";

using Query class

Query = new query();
query.addDataSource(tableNum(InventTable)).addRange(fieldNum(InventTable, itemId)).value("123ABC");

Friday, February 13, 2015

List Page Interaction classe Ax 2012

class SPLPayLeaveEncashListPageInteraction extends ListPageInteraction
{
    SPLPayLeaveEncash   SPLPayLeaveEncash;
}

=======================================================================
public void selectionChanged()
    {

        SPLPayLeaveEncash = this.listPage().activeRecord(queryDataSourceStr(SPLPayLeaveEncashListPage, SPLPayLeaveEncash));

        super();

            if(SPLPayLeaveEncash.Approved == NoYes::Yes || SPLPayLeaveEncash.ProcessWithSalary == NoYes::Yes  )
        {
            this.listPage().actionPaneControlEnabled(formControlStr(SPLPayLeaveEncashListPage, DeleteCommandButton), false);
        }
        else
        {
            this.listPage().actionPaneControlEnabled(formControlStr(SPLPayLeaveEncashListPage, DeleteCommandButton), true);
        }
    }