Inventory Batch Expiry Date in OnHand form

Hi Friends,

In Inventory OnHand form I want the Inventory Batch expiry date for the particular Item when the Item having Batch Number as the Tracking Dimension .I want this as the last field in the overview grid. I wrote the following code as the display method in the InventSum Table .

public display TransDate batchExpiryDate()

{

TransDate expiryDate;

InventBatchId inventBatchId; i

nventBatchId = InventDim::find(this.InventDimId).inventBatchId;

expiryDate = InventBatch::find(inventBatchId,this.ItemId).expDate;

return expiryDate?expiryDate:dateNull();

}

But It not fetching any data Always shows as empty in the grid. Suggestions and solutions are welcome.

Thanks and Regards Muthusamy

this.InventDimId, will not be having the value every time(as the inventSum data is summed up and shown based on the chosen dimensions from the dimension display). Rather take the inventDim buffer, it will have the selected dimensions (if you chose to display the batch number).

Look at the method \Forms\InventOnhandItem\Data Sources\InventSum\Methods\averageCostPriceUnit

I think you already have the expiration date on the Onhand tab.

Hi Kranthi ,

thanks for the reply.

yeah, Expiration date is already on the On Hand tab.

But , I want to Show the expiry date in Overview tab(Client requirement is like that).

When we write a display method in form level like averageCostPriceUnit , this will not helpful to show in grid.

For all grid rows Expiry date value is same based on selected row

that’s why I’m trying table level display method.

Thanks and Regards,

Muthusamy.V

Hi Muthusamy,

Try this code for your display method:

InventDim dim;

;

dim = formJoinedRecord(_inventSum, inventDim_ds);

return InventBatch::find(dim.inventBatchId, _inventSum.ItemId).expDate;

Quan Le,