Hi,
I am using the below mentioned in the modifiedField method of InventTransferLine to create a Invent tranfer line as soon as the value is changed in a particular field.
However, the values are getting updated in all fields except inventory dimensions. Despite updating value in the inventory dimensions it is still taking blank values.
I am posting the code for reference. Kindly let me know if there is any issue in the code snippet:
case fieldNum(InventTransferLine, PwCItemBarCode):
this.initValue();
this.ItemId = "XYZ";
this.initFromInventTable("XYZ");
this.initFromInventTransferTable(inventTransferTable false);
this.InventDimId = inventDimLocal.inventDimId;
this.RemainStatus = InventTransferRemainStatus::Shipping;
this.ShipDate = systemDateGet();
this.ReceiveDate = systemDateGet();
this.LineNum = InventTransferLine::lastLineNum(this.TransferId) + 1;
*This post is locked for comments
Can you check the value till time of insertion of the value in InventDim, there is something which we are missing in during debug i believe.
Also at times i faced similar issue, when i saw the values being inserted in the table but surprisingly not showing (ghost or something ;) ) so, table synchronize or AOT restart resolved the problem.
Finally, why not using eventing framework to for your custom code in modifiedField method.
if I will simply copy-paste above code how value of inventDimLocal.inventDimId will be set initially.
above code shows how you assign new lines inevntDim to inventDimLocal.inventDimId
but above code does not shows how you set value in inventDimLocal.inventDimId
I mean where buffer of inventDimLocal is being set?
in existing AX, method modifiedField() of inventTransferLine I cannot see inventDimLocal
:D
I debugged but the value stays consistent till the time debugger is running.
You could try to replicate by adding a new field on transfer order lines table and then in the modifiedField() of the transfer lines table, paste the above mentioned code.
yeah may be, hidden ghost or vampire eating value, check your server room. don't go alone, take IT infrastructure guy with you :)
if value is being set at time of execution, I believe its being overridden somewhere afterwards. Debug it or give us some information to reproduce scenario.
Hi Sohaib,
Yes the InventDimLocal.InventDimId has value till the time debugger is being exited.
And the value is not getting changed anywhere.
1) Has inventDimLocal.inventDimId a , value at time when code is executed?
2) might be value is changed anywhere after inventDimLocal.inventDimId and before actual insert
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156