In this scenario, we using Dynamic 365 F&O where sales orders are created and inventory is managed for an item called Item A. The unit of measurement for Item A in the inventory is 'Metric Tons (MT)', while the unit used during the sales order creation is 'Kilo Liters (KL)'.
To handle the conversion between KL and MT, a unit conversion standard form has been set up in the system. For example, the standard conversion is defined as 1 KL = 0.88 MT. This means that when the sales order is created, the system automatically converts the sales quantity entered in KL to the corresponding quantity in MT based on the standard conversion and InventTrans having 0.88 value in Qty.
However, the User requirement is to have different unit conversions for specific sales lines. To accommodate this, a custom field has been added to the sales line where users can specify their own conversion factor. For example, if the custom field on a sales line is set to 0.77, it means that 1 KL will be converted to 0.77 MT for that particular sales line.
So, for each sales line for the same item, we want the system to calculate the appropriate inventory quantity (InventTrans qty) based on the sales line's custom field value. In the standard case, the system uses the standard conversion factor (0.88) to perform the calculation. However, for your specific case, you want the system to consider the custom field value (e.g., 0.77 or 0.66) for each sales line to calculate the InventTrans qty accordingly.
I try to write the code in
because I found that the QtyOrder field on salesLine is used for the InventTrans Qty.
it works in salesLine Inventory transactions but when the user did the Packing slip it deducted the standard conversion(0.88) instead of custom which we mention at the line level in our custom field(e.g., 0.77 or 0.66).
this same applies to invoices also.
Is anyone have any other option/solution to achieve this kinda scenario?