Quantcast
Channel: Art Of Creation - Dynamics AX Blog » Job
Viewing all articles
Browse latest Browse all 9

Trivial: by in group by is optional

$
0
0

Here is something I did not know: apparently, the ‘by’ in ‘group by’ is optional.

The following job compiles just fine, and outputs the correct result:

static void KlForGroupBy(Args _args)
{
    InventTable inventTable;
    ;
   
    while select inventTable
    group by ItemGroupId
    {
        info(inventTable.ItemGroupId);
    }
   
    info('------');
   
    while select inventTable
    group ItemGroupId // without by
    {
        info(inventTable.ItemGroupId);
    }
}

It looks funny though :-).


Viewing all articles
Browse latest Browse all 9

Trending Articles