Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Posting picking list for selected saleslines through code

(0) ShareShare
ReportReport
Posted on by 200

How create  picking list(from code), but not for whole SalesOrder, but only for selected lines , e.g. with any checkbox marked.

*This post is locked for comments

  • In AX2012 in the InventOnHandItemListPage I need to be able to f Profile Picture
    499 on at
    RE: Posting picking list for selected saleslines through code

    Dear Piotr_Kulakowski

    Please find the attachments below

    1.

    SalesParamLine.png

    2.

    SalesParamLine.png

    1st Image shows the salesline selected, 2nd Image shows corresponding Packing Slip for sales line , 

    My Requirement is if i select any of the particular salesline (Through Check box),i need only selected lines of Saleline to appear in Picking list Form (Form Name:SalesEditLines),

    In (SalesEditLines Form), the (datasource Salesparamline) has (Join Source Property as SalesParmTable) , and the tables Salesline and SalesParamLine has a relation as SalesParmLine.SalesLineRecId == SalesLine.RecId. 

    with above said properties and relations ,

    Please help me on my Requirement to get only selected lines of salesline  in SalesParamLine.

  • Daljit Kaur Rahsi Profile Picture
    1,260 on at
    RE: Posting picking list for selected saleslines through code

    Hi Piotr,

    With the above mentioned code are you able to perform the printing of picking list just with a click of the button?

    Or did you make any changes in the code, please confirm.

  • Piotr_Kulakowski Profile Picture
    200 on at
    RE: Posting picking list for selected saleslines through code

    Thanks, I found other solution:

    static void autoGenLP(SalesId salesId)

    {

       SalesFormLetter_PickingList salesFormLetter;

       SalesTable      salesTable = salesTable::find(salesId);

       QueryRun queryRun;

       Query query;

       ;

       if (! salesId)

       {

           throw error("@SYS25407");

       }

       try

       {

           salesFormLetter = SalesFormLetter_PickingList::newPickingList();

           query = new Query(QueryStr(SalesUpdate_bon));

           query.dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable, SalesId)).value(salesId);

           query.dataSourceTable(tablenum(InventLocation)).addRange(fieldnum(InventLocation, AutoGenLP_bon)).value(queryValue(NoYes::Yes));

           queryRun = new QueryRun(query);

           salesFormLetter.chooseLinesQuery(queryRun);

           salesFormLetter.transDate(systemDateGet());

           salesFormLetter.update(salesTable,

                                   systemdateget(),

                                   SalesUpdate::All,

                                   AccountOrder::None,

                                   NoYes::No,

                                   NoYes::No);

          // info(strfmt(" ", salestable.SalesId));

       }

       catch

       {

           info('');

       }

    }

  • Verified answer
    Florian Hopfner Profile Picture
    2,451 on at
    RE: Posting picking list for selected saleslines through code

    Take a look at method createParmUpdateFromParmUpdateRecord of the SalesFormLetter framework.

  • Verified answer
    Piotr_Kulakowski Profile Picture
    200 on at
    RE: Posting picking list for selected saleslines through code

    Thanks for answer. But there is no salesFormLetter.createParmUpdate() method in AX2012.

    Do you have any idea?

  • Suggested answer
    Florian Hopfner Profile Picture
    2,451 on at
    RE: Posting picking list for selected saleslines through code

    See How to post picking list for a group of sales orders? for code to post a picking list. One way to do this for only selected lines is to change the query so it only includes the selected lines.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 50

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Featured topics

Product updates

Dynamics 365 release plans