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)

Manually enter Free Text Invoice Numbers

(0) ShareShare
ReportReport
Posted on by

Hi all,

I would like the ability to manually enter free text invoice numbers and would like to know if this is possible? I have changed the number sequence attached to free text invoices to allow manual but then once I go to post a free text invoice I receive an error "Voucher Number cannot be selected automatically" Any assistance would be appreciated.

Thanks!

Ben

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi,

    We did the same process. Modify in CustPostInvoice class run method. Working properly.

    Thanks & Regards:

    Edwin.X

  • Community Member Profile Picture
    on at

    Any Insights on what those modification were?

  • André Arnaud de Calavon Profile Picture
    301,170 Super User 2025 Season 2 on at

    Hi Ben,

    It would indeed require a customization. I wonder if you could also use a general journal and post the invoices as a journal. This is then similar to a vendor invoice journal. You can enter the invoice number manually then. Also make sure the voucher number is equal to the invoice number if required.

  • Community Member Profile Picture
    on at

    Standard AX does not allow manual number for Free text invoice or Sales invoice.  You can customize.

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

    Interestingly, there's already a field called ManualInvoiceID_W on the table CustInvoiceTable, but it's associated with countries LT,LV.  However, you can use the code that makes that work as a good template for making this work yourself.

    In our case, we added another field called ManualInvoiceID to the table.

    In class CustPostInvoice, we added this method.

    private container getNumAndVoucher(NumberSeq _numberSeq)

    {

       container ret;

       if (custInvoiceTable.ManualInvoiceID != '')

       {

           _numberSeq.parmNumberSequenceCode('');

           _numberSeq.parmNumberSequenceId(0);

           ret = [custInvoiceTable.ManualInvoiceID, _numberSeq.voucher()];

       }

       else

       {

           ret = _numberSeq.numAndVoucher();

       }

       return ret;

    }

    And then modified part of the run() method as follows.

    ..

           numberSeq = this.allocateNumAndVoucher();

           // <GEEU>

           if (countryRegion_LTLV)

           {

               [invoiceId, voucher] = this.getNumAndVoucher_W(numberSeq);

               if (! CustInvoiceJour::checkDuplicateNum_W(invoiceId, '', custInvoiceTable.InvoiceDate))

               {

                   throw error("@SYS25904");

               }

           }

           else

           {

           // </GEEU>

           [invoiceId, voucher] = this.getNumAndVoucher(numberSeq);

           // <GEEU>

               if (! custInvoiceJour::checkDuplicateNum_W(invoiceId, '', custInvoiceTable.InvoiceDate))

               {

                   throw error("@SYS25904");

               }

           }

           // </GEEU>

    ..

    We originally considered using a Ledger journal because it allows the specification of the Invoice number, but during posting it collapses all of the offset lines into a single CustInvoiceTrans record, and for our purposes we needed each offset line to generate its own CustInvoiceTrans record with the description intact.

    Hope this helps.

  • Suggested answer
    Mamdouh Profile Picture
    146 on at

    Hi Ben,

    I think using general journal is the best solution for your case and will meet your needs

  • Community Member Profile Picture
    on at

    Just wanted to verify that Brandon Wiese's solution worked for me. The only difference was I had to modify the CustPostInvoice.runInternal() method rather than the standard run(). Thank you for the help!

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans