
in AX 2012 R2 for retail, if items are defined with the tracking dimension batch and sold on POS. At statement calculation an error is thrown that the batch number must be specified.
VERSION
============
AX 2012 R2
Kernel Version: 6.2.1000.4051
Application Version: 6.2.1000.4051
how can i setup system to automatically reserve batches according to system rules (like FEFO)
*This post is locked for comments
I have the same question (0)the dimension batch is not supported by AX Retail. As you cannot enter batch numbers on POS you will run into this error at statement calculation and posting, unless you allow empty issue and receipts for batch.
To avoid the error message at statement calculation there is code update to system classes can solve the issue:
This condition for batch number is checked in method \Classes\RetailTransactionSalesTransMark\reserveInventory
There is revoked method inventMovement.checkDimPhysical
// Check if all required product dimensions are set, if not abort the inventory reservation process.
if (
!inventMovement.checkDimPhysical(rboTransactionSalesTrans.qty,
InventDim::find(rboTransactionSalesTrans.inventDimId),
true)
)
{
ttsAbort;
throw error("@SYS18447");
}
In the code suggestion we have created a new method \Classes\InventMovement\checkDimPhysical_NoBatch similar to method \Classes\InventMovement\checkDimPhysical.
We changed only one condition in this new method to avoid checking Dimension = Batch number
…
while (enumerator.moveNext())
{
inventDimGroupFieldSetup = enumerator.current();
inventDimFieldId = inventDimGroupFieldSetup.dimFieldId();
okTmp = true;
if ((_specificDimensionsToCheck == null || _specificDimensionsToCheck.in(inventDimFieldId)) && (inventDimFieldId != 2))
…
And we used this new method in \Classes\RetailTransactionSalesTransMark\reserveInventory
…
// Check if all required product dimensions are set, if not abort the inventory reservation process.
if (
!inventMovement.checkDimPhysical_NoBatch(rboTransactionSalesTrans.qty,
InventDim::find(rboTransactionSalesTrans.inventDimId),
true)
)
{
ttsAbort;
throw error("@SYS18447");
}
Please test it very thoroughly because it is not official fix but only code suggestion.
I have attached to this email 2 modified classes for comparison.
Disclaimer:
"Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This mail message assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures."