Displaying fields which changes every time

hello all AX users .

I am currently working on a report generation and have only one PageHeader and one SectionGroup in that .

Lets take an example that i have one Invoice ID and it contains multiple Items invoiced in it .

So the main problem which i am facing is that i am unable to display Item Name of all those invoiced items in a column in the SectionGroup. .

And the link to report opens from one form while i want the data to be fetched from other table say CustInvoiceTrans and relation between these two tables is Invoice ID as described earlier…

How can i get it ?

Please suggest me a solution for it …

hi lalit,

you are trying to fetch the data by using fetch method or display method?

Both the methods i am using still i am unable to find the data …

can you share the code what you are written?

Hi Lalit,

You can fetch the data by creating a display() method in the reports → designs-> Automated/Generated → methods and then simply drag and drop the method in the desired section you want to place your field.

I hope this will be useful…Do share the code that you tried using display() method

To Lilly and Ven,

1)Following is the code i have written in fetch method…

public boolean fetch()


while select _Pier_Table where _Pier_Table.RecId == callerrecord.RecId

while select _CustInvoiceTrans where _CustInvoiceTrans.InvoiceId == _Pier_Table.InvoiceNumber


return true;

2)and following is the display method for returning list of item names for a particular Invoice ID

display str getItemName()
return Itemname;

I want to display this in the body section of the Report …

Please tell me if some changes are to be made in the above described code.

Hi Lilly i have done the same thing as you said but i cannot get the result but for your conveniency,i have written the code as tell me the changes to be made.

here you are using the 2 tables and you are looping through two datasources. its better to avoiding the loops and join the datasources in x++ fashion instead of sql queries.

Hi lalit,

can you tell me from which table you are calling the ItemName() ?

If suppose you are calling from inventTable Table, Then the code is

display EDTname methodName()

{ ;

return InventTable::find(this.ItemId).itemName;


Thanks Lilly,

Your solution did really worked …