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 Sales Packing Slip For A List Of Sales Order With X++

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to create one sales packing slip for a list of sales order, my code is here;

salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.showQueryForm(false);
salesFormletter.update(vSalesTable,systemDateGet(),SalesUpdate::DeliverNow,AccountOrder::Account,false,false);


This code works fine, but it has been created for just a sales order. How can I create a sales packing slip for multiple sales orders?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Your buffer vSalesTable (given in your post) should take multiple values of sales order with itself

    here you go at this link

    www.experts-exchange.com/.../Q_26359140.html

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    if you are unable to see code check it here. Make sure to modify parameters as per your need such as if its direct delivery or not

    static void SalesOrderPost2(Args _args)
    {
        SalesFormLetter salesFormLetter;
        QueryRun queryRun;
        Query query;
        str strSalesTable = "V683904, V683905, V683906";
        ;
    
        salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
    
        query = new Query(QueryStr(SalesUpdate));
        query.dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable, SalesId)).value(strSalesTable);
        queryRun = new QueryRun(query);
    
        salesFormLetter.chooseLinesQuery(queryRun);
        salesFormLetter.transDate(systemdateget());
        salesFormLetter.specQty(SalesUpdate::All);
        salesFormLetter.printFormLetter(false);
        
    
        salesFormLetter.chooseLines(false,true);
    
        salesFormLetter.reArrangeNow(true);
    
        salesFormLetter.run();
    
    
    }


  • Community Member Profile Picture
    on at

    Hi Sohaib,

    Your code works fine but it creates packing slips for each sales order. I have multiple sales order, but I want to post them into just one packing slip? Is there any way to do it?

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    To generate combined PackingSlips, I never got chance to write code

    Functionally there is an option to summarize the orders. On tab Options you can change the setting Summary update for e.g. Invoice account. Then click the button Arrange. By doing so orders are summarized into one packing slip. Inside Accounts Receivable parameters, we can setup default settings for  the Summary update.

    I think you need to see what is happening behind the Arrange Button  of form SalesEditLines (form). it is calling a method FORM\SalesEditLines\rearrange(method) 

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans