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)

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,443 User Group Leader 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,443 User Group Leader 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,788 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

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

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans