Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Transfer order lines

Posted on by Microsoft Employee

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

  • Asim Saeed Profile Picture
    Asim Saeed 575 on at
    RE: Transfer order lines

    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.

  • Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: Transfer order lines

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Transfer order lines

    :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.

  • Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: Transfer order lines

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Transfer order lines

    Hi Sohaib,

    Yes the InventDimLocal.InventDimId has value till the time debugger is being exited.

    And the value is not getting changed anywhere.

  • Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: Transfer order lines

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans