Announcements
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; }
Since this is a custom form based on On hand inventory form, could you please share the query being used for the data source?
Try your code and still cannot get the InventDimId value, you post the same code as mine,thanks again
In line 4 of the, you are using the variable d_InventDimId. But you are not using the active buffer that is passed into the display method.
Please try this code and check if you are getting the InventDimId value
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; }
Thank you for your reply. I wrote it in line 4 of the code
You are passing the table buffer (_inventSum) to the display method and are not using it. Can you try this and check if you get any value for InventDimId?
InventDimId d_InventDimId = _inventSum.InventDimId;
Thank you for your reply,This is a Form of personalized development, similar to the summary of on-hand Inventory(Show the inventory quantity of all Items)
Path:Product information management/Common/Released products->Manage inventory->on-hand Inventory
It's not completely empty - it has ItemId and quantities. That's why I assume it's actually grouped. It explains the empty RecId as well - as with other fields, the value of RecId isn't defined if it's neither grouped by nor aggregated.
Hi Danzel,
InventSum record buffer is empty - you should first fix the query behind.
The problem isn't in the code above - the problem is in what query the form uses. It seems it uses grouping and the fields that are neither grouped by not aggregated simply don't have any value fetched from the database.
If you're interested in details, look at the form in question. If you don't understand what's going on and you need help, tell us which form it is.
André Arnaud de Cal...
294,161
Super User 2025 Season 1
Martin Dráb
232,942
Most Valuable Professional
nmaenpaa
101,158
Moderator