Showing posts with label ax - sorting. Show all posts
Showing posts with label ax - sorting. Show all posts

Friday, September 18, 2020

AX - How to sort datasource

Simple add into datasource Init() method this code:
public void init()
{
  super();    
           
  smmEncyclopediaItems_ds.query().dataSourceNo( 1 ).
    addSortField( fieldNum( smmEncyclopediaItems, ParentId ), SortOrder::Ascending );
  smmEncyclopediaItems_ds.query().dataSourceNo( 1 ).
    addSortField( fieldNum( smmEncyclopediaItems, order ), SortOrder::Ascending );
  smmEncyclopediaItems_ds.query().dataSourceNo( 1 ).
    addSortField( fieldNum( smmEncyclopediaItems, ItemName ), SortOrder::Ascending );        
}

Friday, February 28, 2020

AX - How to make sorting in grid column

Override datasource Init() method:
public void init()
{
    super();

    this.query().dataSourceNo( 1 ).addSortField( fieldNum( CIEB_Torque, cieb_datetime ), 
      SortOrder::Ascending );
}
Output: