Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Unanswered

Display method on field CustPackingSlipTrans.InventTransId

Posted on by 1,853
Hi Experts,
 
There is Enquiry form have display method as below. 
 
 Somehow MRP Master planning setup by third party then notice. Form InvoiceId and Invoice Date is coming wrong.
 
this.InventTransId is coming from CustPackingSlipTrans.InventTransId
Display Invoicedate Invdate()
    {
        CustInvoiceTrans custInvoiceTrans;
        select custInvoiceTrans where custInvoiceTrans.InventTransId==this.InventTransId;
        return custInvoiceTrans.InvoiceDate ;
    }
Below Screenshot is comparision
 
This Data is from Sales Packing Slip highlighted is wrong      
Sales Order Load Number Invoice Id Invoice Date Packing slip Ship date Invoice account
SO-117272 LD-127674 SI-148550 9/4/2024 DN-168216 9/4/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-168217 9/4/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-168218 9/4/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-168286 9/5/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-168287 9/5/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-168353 9/7/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-168582 9/10/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-168860 9/15/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-169038 9/17/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-169039 9/17/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-170131 10/5/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-170132 10/5/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-170133 10/5/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-170204 10/6/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-170280 10/7/2024 100290
SO-117272 LD-127674 SI-148550 9/4/2024 DN-170281 10/7/2024 100290
             
             
             
             
This Data is from Inventory trasactions is correct      
Sales Order Invoice Item number Product name Color Size Style
SO-117272 SI-148550 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-148550 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-148550 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-148594 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-148594 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-148594 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-148654 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-148828 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-149058 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-149205 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-149205 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-150130 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-150130 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
SO-117272 SI-150130 601-17-975-0110 XLPE Roll 1.2mWX20mLX10mm Plain FR Black 1.2mWX20mLX10mm Plain
 
 
Thanks,
 
Faiz
  • Martin Dráb Profile Picture
    Martin Dráb 229,963 Most Valuable Professional on at
    Display method on field CustPackingSlipTrans.InventTransId
    Your code selects the first invoice that happen to be returned from database. Then you said that it was wrong, but not what result you'd considered correct. If you want to display a single invoice ID and date but you several invoices (with different IDs and dates), which ones do you want to show?
     
    InvoiceTransRefRecId is populated if CustFormletterParameters.PckSlpInfoOnInvoice parameter is enabled, which apparently isn't the case in your environment. You can look at SalesInvoiceJournalCreate.setCustInvoiceTransRef() if you're interested in more details.
  • faiz7049 Profile Picture
    faiz7049 1,853 on at
    Display method on field CustPackingSlipTrans.InventTransId
    Hi Martin,
     
    Display method I defined in View than used in Form. Sales order, Load Number, Invoiced Id and Invoice Date is display method.




    Which relation should I have to use between CustPackingSlipTrans and CustInvoiceTrans tables . I checked on table relation is 
    CUSTPACKINGSLIPTRANS.INVOICETRANSREFRECID = CUSTINVOICETRANS.RECID
    I used in SQL query but nothing is showing.
     
    SELECT 
        CUSTINVOICETRANS.INVOICEID,
        CUSTPACKINGSLIPTRANS.PACKINGSLIPID
    FROM 
        CUSTPACKINGSLIPTRANS
    JOIN 
        CUSTINVOICETRANS 
    ON 
        CUSTPACKINGSLIPTRANS.INVOICETRANSREFRECID = CUSTINVOICETRANS.RECID
    My objective to get InvoiceId and InvoiceDate by using display method. In below display method InvoiceDate is coming but if there is multiple invoices exists than is coming wrong. this.InventTransId is coming from CustPackingSlipTrans.
     
    Display Invoicedate Invdate()
        {
            CustInvoiceTrans custInvoiceTrans;
            select custInvoiceTrans where custInvoiceTrans.InventTransId==this.InventTransId;
            return custInvoiceTrans.InvoiceDate ;
        }
    Display InvoiceId InvoiceId()
        {
            CustInvoiceTrans custInvoiceTrans;
            select custInvoiceTrans where custInvoiceTrans.InventTransId==this.InventTransId;
            return custInvoiceTrans.InvoiceId ;
        }
    Thanks,
    Faiz
     
  • Martin Dráb Profile Picture
    Martin Dráb 229,963 Most Valuable Professional on at
    Display method on field CustPackingSlipTrans.InventTransId
    I'm struggling with understanding of what you're saying.
     
    For example, "Somehow MRP Master planning setup by third party then notice" doesn't even sound like a sentence to me.
     
    It's not clear to me where you've defined the display method. If it's really on the form, you're likely missing a parameter.
     
    Saying just "the data is wrong" isn't a very detailed description of your problem.
     
    Could you please explain your problem once more and include what you found when you try to debug your solution?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,963 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans