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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Adding a condition before invoicing a sales order

(0) ShareShare
ReportReport
Posted on by 85

Hi Guys,

I need to add a validation while invoicing a sales order. A sales order should be invoiced only if the condition is met. 

I tried to put my code in validate method of SalesFormLetter_Invoice. is this the right place to do it?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    Hi Bharath B J,

    There are 3 different places to put your validation:

    1) SalesFormLetter_Invoice you can put validation that will happened on click button. As you can see from exiting methods you can prompts to get user input, as for me usually used to check salesEditLines form parameters.

    2) SalesInvoiceJournalCreate usually has validation of parm* tables and sales lines\header before journal creation.

    3) SalesInvoiceJournalPost has validation of journal before posting.

    However you can find methods in SalesInvoiceJournalPost  that checks parm* tables and sales lines as well.

    Personally I prefer to put validation to SalesInvoiceJournalPost if it does not require user input or does not validate parm* tables, otherwise to SalesFormLetter_Invoice.

  • Bharath B J Profile Picture
    85 on at

    Hi Miroshnikov,

    Thank you so much for this!

    I just have a field in SalesTable, which is of type enum:

    Something like this:

    if(salestable.JTM == JTM::None)

           {

               info("Please select a Sales order type other than None");

           }

    So as per you said, the best place to put this would be in "validate" method on SalesFormLetter_Invoice.

    Am i correct?

  • Mea_ Profile Picture
    60,286 on at

    Yep, don't forget that you can have multiply sales orders in one posting so it makes sense to specify sales order id in your message.

  • Prudviraj Guduru Profile Picture
    25 on at

    Hi..

    I need to invoke a custom dialog form where the user will fill in the inputs on close ok of Sales Edit lines posting form during delivery note posting. I also need to capture the journal information like journal Num after the journal has been created and posted in a custom table containing fields of dialog user inputs and journal Number

    Please suggest a better solution to achieve this 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans