Wednesday, 1 November 2006

Bug in Axapta V3 SP4 "SelectLocked Incorrect call" expected to be Fixed in SP7 :-(

Whilst helping a customer during implementation of their Axapta system I came across a bug, I have notified the support organisation and have been told it wil be fixed in SP7 which I find rather baffling as the bug steems from code introduced in SP4.

Anyhow.

If you are using IMTS, and have installed SP4 and are using physical valuation and you have activated the warehouse dimension then a bug / erroneous error message is generated.

The bug is an error message is generated if your try to generate a Purchase order from a sales order and in a number of other cases (not all have been identified) one other is if you delete a production that is referenced to a sales order.

The message :

You get an error message stating that you have called inventsumTTS.inventItemLocationSelectLocked incorrectly.

This is due to the following code added in SP4 to the inventMovement.EstimatedFinancialValue method

if (this.inventModelGroup().InclPhysicalValueInCost)
{
inventDimFinancial = InventDim::findOrCreate(inventDimFinancial);financialInventOnHand = InventOnHand::newItemDim(this.itemId(), inventDimFinancial, inventDimParmFinancial, true);
}

The last parameter is the lock clause in the InventOnHand new which forces a verification of lock on such modifications.

I have corrected the bug, by adding a new method exposing the lock parameter of an InventOnHand instance which I have called

LockSet.boolean LockSet()
{
return lock;
}

Then I have modified the above code to :

if (this.inventModelGroup().InclPhysicalValueInCost)
{
inventDimFinancial = InventDim::findOrCreate(inventDimFinancial);financialInventOnHand = InventOnHand::newItemDim(this.itemId(), inventDimFinancial, inventDimParmFinancial, _InventOnhand.LockSet());
}

Which perpetuates the Lock state from the caller on to the possible new inventonhand instance created.

If anyone wants them I can forward or perhaps post the actual fix xpo or a link to it if desired please comment, otherwise it should be pretty straight forward to follow the explanations given and effect a fix from them.

Besides I am sure most of you would rather have the pleasure of doing your own fix ;-) whilst waiting for MS to publish SP7.

/Sven

No comments: