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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

PurchFormLetter_PackingSlip not posting Packing slip

(0) ShareShare
ReportReport
Posted on by 40

I have this code, which won't post the Packing slip. This code worked before, but now it does not create a new packing slip and does not post it.
I think there is something with Purchase Order field values, but can't find what it is. Order is Confirmed. I can create new packing slip manually through user interface.

Where can I find the actual logic for posting process in code?

PurchTable _purchTable = PurchTable::find("HS00000069");
PackingSlipId packingSlipId = "HS00000069-01";

PurchFormLetter_PackingSlip purchFormLetter_PackingSlip = PurchFormLetter::construct(DocumentStatus::PackingSlip);
purchFormLetter_PackingSlip.showQueryForm(false);
purchFormLetter_PackingSlip.purchTable(_purchTable);
purchFormLetter_PackingSlip.transDate(DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()));
purchFormLetter_PackingSlip.specQty(PurchUpdate::ReceiveNow);
purchFormLetter_PackingSlip.printFormLetter(NoYes::No);
purchFormLetter_PackingSlip.parmParmTableNum(packingSlipId);

purchFormLetter_PackingSlip.chooseLines(true);

purchFormLetter_PackingSlip.runOperation();

I have the same question (0)
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at

    The actual posting is done in PurchPackingSlipJournalPost class.

    Which version of AX is it about? Shouldn't I move this thread to Dynamics 365 Supply Chain Management forum?

  • Yevhen Voloshchenko Profile Picture
    40 on at

    Latest version, which means you may move this post to Dynamics 365 Supply Chain Management. Thanks for your answer. I'll mark it if it will be enough for me after some edbugging.

  • Yevhen Voloshchenko Profile Picture
    40 on at

    So in the process of debugging I found out that system does not enter PurchPackingSlipJournalPost. What may be the cause of such behaviour?

  • Yevhen Voloshchenko Profile Picture
    40 on at

    Found out that by some reason PurchFormLetterParmData does not create PurchParmTable record and posting process does not occur.

  • Suggested answer
    Yevhen Voloshchenko Profile Picture
    40 on at

    The problem caused this line:
    purchFormLetter_PackingSlip.specQty(PurchUpdate::ReceiveNow);

    I tried to create packing slip for lines with not filled "Receive now" - PurchPhysicalReceive value.

    If you fill "Receive now" value or change PurchUpdate::ReceiveNow to PurchUpdate::All - everything works fine.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 227

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 193 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 120 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans