web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Create Transfer Order in X++

(0) ShareShare
ReportReport
Posted on by 1,080

Hi,

I need to create a Transfer Order header and line with X++. Is there a way to do this. I guess I need some basic sintax to get me started. I have been able to create SO and PO with x++, but I'm trying to get it done for TO and the compilor gives me sitax errors .. :(

Thanks!

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Eduardo,

    Check out the following link:  http://www.mail-archive.com/development-axapta@yahoogroups.com/msg12219.html

     

    This link too:  http://graycloud.com/axapta/transfer-order-status-t6665.html

     

     

    This should give you a solid start! 

     

    Regards.

  • EduardoAndres Profile Picture
    1,080 on at

    Great .. thank you!

  • EduardoAndres Profile Picture
    1,080 on at

    I found the articles you gave me really helpful. Although I'm facing some issues when creating the TO, I think I'm preety close to the solution thanks to your help.

    Eduardo

     

    PS: I will post the finished code here when I'm done to help someone else in the future

  • Community Member Profile Picture
    on at

    Legend says he's still coding!

  • Shatakshi Raman Profile Picture
    10 on at

    He still is

  • Deepak Agarwal Profile Picture
    8,602 on at

    Hey,

    What errors are you facing now.

  • Shatakshi Raman Profile Picture
    10 on at

    Thanks for responding!

    I am using the following code to create and ship a transfer order till picking status. The data is inserting into to th InventTransferLine table, but it still keeps showing the error of No lines for posting error. Kindly look into it, and help me resolve it :

    public static void CreateTransferOrder(ItemId item, InventLocationId fromloc, InventLocationId toloc, inventDimId DimId)

    {

       InventSum                       inventSum;

       InventQtyAvailPhysicalDim       qty_ship;

       inventTransferTable             inventTransferTable;

       inventTransferLine              inventTransferLine;

       numberSequenceReference         numberSequenceReference;

       InventTransferParmTable         invTransParmTbl;

       numberSeq                       numberSeq;

       InventTransferUpdShip                  inventTransferUpdShip;

       ;

       inventSum                       = InventSum::find(item, DimId, false);

       qty_ship                        = inventSum.AvailPhysical;

           ttsBegin;

       inventTransferTable.clear();

       inventTransferTable.initValue();

       numberSequenceReference = InventParameters::numRefTransferId();

       numberSeq = numberSeq::newGetNumFromCode(numberSequenceReference.numberSequenceTable().NumberSequence);

       inventTransferTable.TransferId = numberSeq.num();

       inventTransferTable.InventLocationIdFrom = fromloc;

       inventTransferTable.modifiedField(fieldNum(InventTransferTable,InventLocationIdFrom));

       inventTransferTable.InventLocationIdTo = toloc;

       inventTransferTable.modifiedField(fieldNum(InventTransferTable,InventLocationIdTo));

       inventTransferTable.TransferStatus = InventTransferStatus::Created;

       inventTransferTable.insert();

       ttsCommit;

           ttsBegin;

       inventTransferLine.clear();

       inventTransferLine.initFromInventTransferTable(inventTransferTable,NoYes::Yes);

       inventTransferLine.ItemId = item;

       inventTransferLine.initFromInventTable(InventTable::find(item));

       inventTransferLine.QtyTransfer = qty_ship;

       inventTransferLine.QtyShipNow = 5;

       inventTransferLine.QtyReceiveNow = 5;

       inventTransferLine.LineNum = 1;

       inventTransferLine.insert();

       info(strFmt("@SHA179" , inventTransferTable.TransferId ));

           ttsCommit;

       invTransParmTbl.TransferId = inventTransferTable.TransferId;

       invTransParmTbl.EditLines = true;

       invTransParmTbl.AutoReceiveQty = true;

       invTransParmTbl.UpdateType = InventTransferUpdateType::Shipment;

       invTransParmTbl.ExplodeLines = NoYes::Yes;

       invTransParmTbl.TransDate = today(); //shipment date

       invTransParmTbl.InventDimFixedReceiveList = 0;

       invTransParmTbl.PickUpdateQty = InventTransferPickUpdateQty::All;

       invTransParmTbl.TransDate = systemDateGet();

       inventTransferUpdShip = InventTransferUpdShip::newParmBuffer(invTransParmTbl);

       inventTransferUpdShip.run();

    P.S  The transfer order does gets created

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans