Question Status

Verified
syed baber asked a question on 15 Jun 2014 5:34 AM

Hi,

I am using the code from the following link to post the transfer order using X++ code:

blog.slcconsulting.us/.../posting-a-transfer-order-using-x

I have a scenario to post a transfer order after the purchase order invoice is posted. I am taking the information from vendinvoicejour and vendinvoiceTrans tables to fill the transfer order header and line tables. But when I am calling the InventTransferUpd.Run method, I am getting the below error:

No lines for posting. Update has been cancelled.

Can anyone please let me know what I am missing here or if someone can share the exact code to post the transfer orders using code that would be great.

Thanks,

SB.

Reply
Verified Answer
syed baber responded on 15 Jun 2014 11:27 PM

I was missing to set the transit warehouse on transfer order header. After setting this, the error is gone and transfer order posted successfully. But the error was very misleading and didn't specify that the transit warehouse is missing, even through it is mandatory on InventTransferTable.

Reply
Suggested Answer
Nitesh Ranjan responded on 15 Jun 2014 6:48 PM

For me it seems issue may because the Trasfer order is not getting save before posting it.

Please validate if you are doing all the process (creating and posting Transfer order ) in single ttsbegin and ttscommit

if yes i suggest you to have it in two different transaction.

Please verify and update us with your findings


Please update with your feedback.

Regards, NITESH RANAJN (PMP) | Dynamics AX Consultant

If this post helps you, Please verify this answer and earn Thank you Badge for yourself (Follow this link for more details https://community.dynamics.com/braggerbadges/badge/48.aspx)

Reply
Suggested Answer
Nitesh Ranjan responded on 15 Jun 2014 7:17 PM

please verify if - InventDimId is updated with appropriate value or not.

If not then may be you need to review your logic the way you are creating Transfer order line


Please update with your feedback.

Regards, NITESH RANAJN (PMP) | Dynamics AX Consultant

If this post helps you, Please verify this answer and earn Thank you Badge for yourself (Follow this link for more details https://community.dynamics.com/braggerbadges/badge/48.aspx)

Reply
Denis Macchinetti responded on 15 Jun 2014 2:06 PM

Hi Syed

I think the issue depend from the UpdateType filed.

E.g., if it's set to PickingList, you have to create the Picking of the Transfer order before.

Thanks & Regards

Denis Macchinetti

Senior Technical Architect

Reply
syed baber responded on 15 Jun 2014 2:16 PM

Hi Denis

I have set the update type to shipment. Sorry forgot to mention this.

Reply
syed baber responded on 15 Jun 2014 3:49 PM

Hi Denis,

I am using the following code to post the transfer order:

       inventTransferParmTable.TransferId      = inventTransferTable.TransferId;

       inventTransferParmTable.EditLines       = true;

       inventTransferParmTable.AutoReceiveQty  = true;

       inventTransferParmTable.ExplodeLines    = true;

       inventTransferParmTable.UpdateType      = InventTransferUpdateType::Shipment;

       inventTransferParmTable.TransDate       = systemDateGet();

       inventTransferParmTable.ShipUpdateQty   = InventTransferShipUpdateQty::All;      

       inventTransferUpd = InventTransferUpdShip::newParmBuffer(inventTransferParmTable);

       inventTransferUpd.run();

Reply
Suggested Answer
Nitesh Ranjan responded on 15 Jun 2014 6:48 PM

For me it seems issue may because the Trasfer order is not getting save before posting it.

Please validate if you are doing all the process (creating and posting Transfer order ) in single ttsbegin and ttscommit

if yes i suggest you to have it in two different transaction.

Please verify and update us with your findings


Please update with your feedback.

Regards, NITESH RANAJN (PMP) | Dynamics AX Consultant

If this post helps you, Please verify this answer and earn Thank you Badge for yourself (Follow this link for more details https://community.dynamics.com/braggerbadges/badge/48.aspx)

Reply
syed baber responded on 15 Jun 2014 7:08 PM

Hi Nitesh,

I was creating the transfer with Transfer status shipped, so when I changed it to Created, I am no longer getting this error now. But now I am getting below errors:

Inventory dimension Site is mandatory and must be specified.

Inventory dimension Warehouse is mandatory and must be specified.

I have already set the InventDimId for InventTransferLine, but still getting this error. Do you have any idea what might be causing this error?

Reply
Suggested Answer
Nitesh Ranjan responded on 15 Jun 2014 7:17 PM

please verify if - InventDimId is updated with appropriate value or not.

If not then may be you need to review your logic the way you are creating Transfer order line


Please update with your feedback.

Regards, NITESH RANAJN (PMP) | Dynamics AX Consultant

If this post helps you, Please verify this answer and earn Thank you Badge for yourself (Follow this link for more details https://community.dynamics.com/braggerbadges/badge/48.aspx)

Reply
Verified Answer
syed baber responded on 15 Jun 2014 11:27 PM

I was missing to set the transit warehouse on transfer order header. After setting this, the error is gone and transfer order posted successfully. But the error was very misleading and didn't specify that the transit warehouse is missing, even through it is mandatory on InventTransferTable.

Reply