Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Counting how many times, formula have used on prod.order

$
0
0

Hi All,

I am newbie on AX...

I am using AX 2009 and have a problem...

I want to create a report that contains a formula about how many times I have used to create a production order.

I used BOM Table as Data Source Report and Create Method on AOT BOM Table like this :

display int64 counter()
{
    ProdTable ProdTable;
    BOMTable BOMTable;
    int64 x;

    while select count(RecId)
    from ProdTable
    join BOMTable
    group by BOMTable.BOMId
    where BOMTable.BOMId == this.BOMId
        {
            x= ProdTable.RecId;
        }
     return x;
}

And then I call that method in programable section (body) and the result is 0 for all formula.

I have script like this on my fetch method in my report :

Int64 z;

Select Count (RecId) From ProdTable Join BOMTable

Where ProdTable.BOMId == BOMTable.BOMId

&& ProdTable.DlvDate >= FromDate

&& ProdTable.DlvDate <= ToDate;

z = ProdTable.recID

and the results are not what I want.

I want the results like this :

Periods : Jan 1, 2017 - Jan, 31, 2017

BOMID                                 Used

BOM-0001                             15

BOM-0002                             20

BOM-0003                             23

May someone help me...???

Thanks in advance...


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>