Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

RE: Form InventOnhandItem and display modifier by two datasources

$
0
0

The reason there is no InventDimId is because the fields in the InventDim buffer are the result of a query (for which zero or more fields are returned based on the configuration of the form) and not actual records in the InventDim tables.

In your display method, you can always do something like this to create an actual records from the combination of fields that's been returned by the query.

InventDim  inventDimLocal;

;

inventDimLocal.data(inventDim);

inventDimLocal = InventDim::findOrCreate(inventDimLocal);

.. = InventItemLocation(itemId, inventDimLocal.InventDimId);

That is the standard mechanism for taking a collection of fields in InventDim and assigning them an InventDimId, first by looking up if that combination of fields already exists, and by creating a new InventDimId as necessary.

While this would be standard practice in a class that needed an InventDimId, it's a little unusual to do it in a display method for a grid.  Another alternative would be write another ::find(..) method on InventItemLocation that uses the InventDim buffer "as is" and does not require an InventDimId.  That would be my preferred solution in this case.


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>