Skip to main content

Notifications

Announcements

No record found.

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 786
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 
  • Verified answer
    Arcadi  Profile Picture
    786 on at
    Posting Packing slip / Project packing slip by code
    So it was because the order was not confirmed. 
  • Arcadi  Profile Picture
    786 on at
    Posting Packing slip / Project packing slip by code
    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();
        }
     
  • André Arnaud de Calavon Profile Picture
    294,349 Super User 2025 Season 1 on at
    Posting Packing slip / Project packing slip by code
    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?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,349 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,029 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans