Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

To get Invoice Id on Sales Order form

Posted on by 1,877

Hello Friends ,

I am writing display method to get invoiceId on Sales Order form. Same you can also get invoice amount on form just to change select InvoiceAmount  instead of InvoiceId and return type also to InvoiceAmount.

Display InvoiceId   invoiceID()
{
    SalesTable salesTable;
    CustInvoiceJour custInvoiceJour;
    ;
    salesTable = SalesTable::find(this.SalesId);
    select InvoiceId from custInvoiceJour where custInvoiceJour.SalesId == salesTable.SalesId;
    return custInvoiceJour.InvoiceId;
}

*This post is locked for comments

  • Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: To get Invoice Id on Sales Order form

    Ok.

    And if you already have SalesId why you using SalesTable::find() ?

    You code should looks like:

    {
        return CustInvoiceJour::findFromSalesId_IN(this.SalesId).InvoiceId;
    }


    But, which invoiceId will be displayed if one sales order have several invoices? 

  • faiz7049 Profile Picture
    faiz7049 1,877 on at
    RE: To get Invoice Id on Sales Order form

    I am not asking, this post for those who do not know how to display method works

  • Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: To get Invoice Id on Sales Order form

    And what is the question?

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans