Pages

January 09, 2015

How to add new fields/Methods in Listpage from in AX 2012

How to add new fields/Methods in List page from in AX 2012
Here we use the Production Order list page for example
Open Production order list page from below link
Production control/Common/Production orders/All production orders
clip_image002
Now we need to add one new field “Serial Number” in this grid (Assuming there will be only one item in one Production order in every case).
This serial number is available in “Transaction” from of this production order.
Untitled
Now to display new fields you can add a new display method in table and drag-drop this method in a grid as a field.
Add one new method in “ProdTable” table add copy below code
display InventSerialId inventTransInventSerialId()
{
InventTransOrigin InventTransOrigin;
InventTrans InventTrans;
;
select InventTrans join InventTransOrigin
where InventTrans.InventTransOrigin == InventTransOrigin.RecId &&
InventTrans.ItemId == InventTransOrigin.ItemId &&
InventTransOrigin.ReferenceId == this.ProdId &&
InventTransOrigin.ItemId == this.ItemId;
return InventDim::find(InventTrans.inventDimId).inventSerialId;
}
Now set DataSource property of this new field as ProdTable. Save your from and compile for any error.
Now open this from, here is your from
clip_image008

-Harry

2 comments:

  1. If i want to filter this grid with the 'serial number' field, which is basically a display method then how can i achieve it ?

    ReplyDelete
  2. Hi Rashid,

    Sorry to say, but on display method there is no direct way to get filter option.
    There are some methods to get SIMILAR functionality. Let me check if I am having the code.

    Thanks
    Deepak

    ReplyDelete

Thanks