Vendor Transactions Report based on given dates.

Hi All,

I need a vendor transactions report based on given dates through coding in ax 2009.

The report should be opened from menu item output(From,To Dates and Vendor Account).

Please reply ASAP.

Thanks in Advance.

You can probably look at the Account Statement in AP → Reports → Transactions → Vendor → Account Statement

Hi,

Its very simple.We can achieve this by using report query.

Add vend table in data source.

Add vendtrans in child data source.

Add trans date as range.

In child data source properties give relation to yes.

By using generated design you can run the report.

Try this hope it will work. I could not explain fully since I dont have ax 2009 instance.

Hi,

Thanks for ur reply but my requirement is to create a report through code with range of dates

Get fromdate and todate value using dialog.

while select _vendtable join
_vendtrans where _vendtable.AccountNum == _vendtrans.AccountNum

_vendtrans.transdate >= fromdate &&

_vendtrans.transdate <= todate
{
element.execute(controlnumber);

}

What does this really mean?

Hi ,

I have to open my report through menu item output by giving FromDate, ToDate and VendorAccount .I wrote fetch method ,dialog,getfromdialog in my report.

The report shouln’t contains any datasource .

This is my fetch code,

public boolean fetch()

{

boolean ret;

boolean printTotal = false;

;

while select vendTable

{

while select vendTrans where vendTrans.AccountNum == vendTable.AccountNum

&& vendTrans.TransDate >=FromDate && vendTrans.TransDate<=ToDate

{

if (vendTable.AccountNum != vendTableAccount1)

{

vendTableAccount1 = vendTable.AccountNum;

element.execute(1);

if (subTotal || printTotal)

{

element.execute(3);

subTotal = 0;

printTotal = true;

}

}

transDate = vendTrans.TransDate;

amountMST = vendTrans.AmountMST;

element.execute(2);

subtotal += vendTrans.AmountMST;

total += vendTrans.AmountMST;

}

element.execute(3);

}

element.execute(4);

return true;

}

Please help me to do this requirement.

you can apply an existJoin with the vendTrans on the fisrt while select vendTable and can move the date criteria to the same loop, which will avoid un necessary data looping and fetching to an extent.