≡ Menu

dynamics ax 2012 form datasource sort X++

Today I got requirement to insert record at run time and shows result in sorted order. I used following code code snippets. Suppose we are sorting on Customer
in required field

CusTable_ds.query().dataSourceNo(1).sortClear();

CusTable_ds.query().dataSourceNo(1).addSortField(fieldNum(CustTable, AccountNum), SortOrder::Ascending);
CusTable_ds.executeQuery();

{ 0 comments… add one }

Leave a Comment