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
Answered

Posting Packing slip / Project packing slip by code

(1) ShareShare
ReportReport
Posted on by 796
Hello, I'm trying to post a packing slip from a SalesTable with the code: 
protected void createPackingSlip(SalesTable _salesTable)    {        SalesFormLetter         salesFormLetter;                salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip, classStr(FormLetterService),            methodStr(FormletterService, postSalesOrderPackingSlip), SysOperationExecutionMode::Synchronous);                               salesFormLetter.update(_salesTable, systemDateGet(), SalesUpdate::All, AccountOrder::None, NoYes::No, NoYes::No, NoYes::No);    }
With this code nothing happens, no error neither no packing slip, yet if I change the DocumentStatus to ProjectPackingSlip it works fine and creates a packing Slip:
 
protected void createPackingSlip(SalesTable _salesTable)    {        SalesFormLetter         salesFormLetter;                salesFormLetter = SalesFormLetter::construct(DocumentStatus::ProjectPackingSlip, classStr(FormLetterService),            methodStr(FormletterService, postSalesOrderPackingSlip), SysOperationExecutionMode::Synchronous);                               salesFormLetter.update(_salesTable, systemDateGet(), SalesUpdate::All, AccountOrder::None, NoYes::No, NoYes::No, NoYes::No);    }
 
My questions are what could be happening that I cannot post a packing slip yet I get no error? What are the implication of using a /ProjectPackingSlip/ instead of a /PackingSlip/? It creates a record in CustPackingSlipJour anyways... 
 
Thanks 
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    304,508 Super User 2026 Season 1 on at
    Hi Arcadi,
     
    Can you provide some more information like if the sales order is linked to a project or not? How is the order created?
  • Arcadi Profile Picture
    796 on at
    Hi Andre, It's created by code: 
     
    protected SalesTable createSalesHeader(InventLocationId _locId, CustAccount _custAc)
        {
            SalesTable salesTable;
            NumberSeq  numberSeq;
    
            numberSeq = NumberSeq::newGetNum(SalesParameters::numRefSalesId());
            salesTable.SalesId = numberSeq.num();
            salesTable.initValue();
            salesTable.CustAccount = _custAc;
            salesTable.initFromCustTable();
            //...              
    
            if (!salesTable.validateWrite())
            {
                //...
            }
            
            return salesTable; //then I do salesTable.insert();
        }
     
  • Verified answer
    Arcadi Profile Picture
    796 on at
    So it was because the order was not confirmed. 

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 144 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

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

#3
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 108

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans