I tried adding this method to the InventSum data source table to obtain the InventBatch table, but the Display method failed to obtain the InventDimId value.
I can only get the value of itemId and not the value of InventDimId. Why?What should I do?

display ExpirationDate ExpDate(InventSum _inventSum)
{
ItemId d_itemId = inventSum.ItemId;
InventDimId d_InventDimId = inventSum.InventDimId;
InventBatchId d_batch = InventDim::find(d_InventDimId).inventBatchId;
ExpirationDate l_date = InventBatch::find(d_batch,d_itemId).expDate;
return l_date;
}