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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

In sales invoice report, I want show multiple packing slip id's. How to achieve this?

(0) ShareShare
ReportReport
Posted on by 85

I am creating a sales order with a item quantity 12 , then splitting and packing it as 6. i.e. 6 packing slips. Then I am clicking Invoice button in action pane, selecting 3 from 6 packing slips and clicks ok, I want to show the packing slip id's in the sales invoice report. Help me guys.

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    one way can be as below

    while select PackingSlipId from custPackingSlipTrans

                   where custPackingSlipTrans.InvoiceTransRefRecId == custInvoiceTrans.RecId

    //collect strings of PackingSlipId  spepearetd by comma or hyphen or any separator and finally display it on report

  • imrankhan_abdul Profile Picture
    85 on at

    I have seen this relation but no value gets stored in the InvoiceTransRefRecid field of custpackingslip trans table.

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    I am sorry to say , I will not be able to help you further  on the thread, since I don't know details of posting mechanism of your system also I don't have access to your system.

    we can wait for some other contributors, which may present us a better direction to get this information

  • Suggested answer
    Brandon Wiese Profile Picture
    17,790 on at

    Unfortunately the InvoiceTransRefRecId field on CustInvoiceTrans appears to not work anymore in R2/R3.

    There are a couple of other ways you can arrive at the matching CustPackingSlipTrans records given a CustInvoiceTrans record.

    The CustInvoicePackingSlipQuantityMatch table connects CustInvoiceTrans records to CustPackingSlipTrans records.

            select custPackingSlipTrans
                exists join custInvoicePackingSlipQuantityMatch
                where custInvoicePackingSlipQuantityMatch.PackingSlipSourceDocumentLine == custPackingSlipTrans.SourceDocumentLine
                   && custInvoicePackingSlipQuantityMatch.InvoiceSourceDocumentLine     == custInvoiceTrans.SourceDocumentLine;

    If that doesn't work for you, InventTrans should also provide a connection between them.

            inventTransOrigin = InventTransOrigin::findByInventTransId(custInvoiceTrans.InventTransId);
    
            select PackingSlipId
                from inventTrans
                where inventTrans.InventTransOrigin     == inventTransOrigin.RecId
                   && inventTrans.DateFinancial         == custInvoiceTrans.InvoiceDate
                   && inventTrans.InvoiceId             == custInvoiceTrans.InvoiceId
                   && inventTrans.Qty                   != 0
                   && inventTrans.PackingSlipReturned   == 0
                   && inventTrans.StatusReceipt         <= StatusReceipt::Purchased
                   && inventTrans.StatusIssue           <= StatusIssue::Sold;
    

    Hope this helps.

  • Verified answer
    imrankhan_abdul Profile Picture
    85 on at

    This helped me,

    while select Qty, PackingSlipId, DeliveryDate from custPackingSlipTrans

           where custPackingSlipTrans.InventTransId == _custInvoiceTrans.InventTransId

           exists join inventTransOrigin

               where inventTransOrigin.InventTransId == custPackingSlipTrans.InventTransId

           exists join inventTrans

               where inventTrans.InventTransOrigin == inventTransOrigin.RecId            &&

                   inventTrans.PackingSlipId == custPackingSlipTrans.PackingSlipId &&

                   inventTrans.InvoiceId == _custInvoiceJour.InvoiceId

       {

              hasCustPackingSlipTrans = true;

           packingSlipDetails += strFmt("@SYS322353", custPackingSlipTrans.Qty,

               custPackingSlipTrans.PackingSlipId,

               date2str(custPackingSlipTrans.DeliveryDate, -1, -1, -1, -1, -1, -1, DateFlags::FormatAll));

           packingSlipDetails += '\n';

    }

    found this under,  classes -> salesinvoicedp -> Loadcustpackingsliptrans.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dekion Profile Picture

dekion 4

#2
Virginia99 Profile Picture

Virginia99 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans