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)

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,284 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,284 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

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