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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

validation on sales invoice creation

(0) ShareShare
ReportReport
Posted on by

Hi,

I need to validate unit price is zero on invoice button click in the sales order.

Kindly assist. 

Thanks in advance.

Regards,

Selva

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: validation on sales invoice creation

    Thanks a lot.. Chaitanya Golla

  • Ajit Profile Picture
    8,755 on at
    RE: validation on sales invoice creation

    And what about when you are posting packing slip, Are you posting that with zero price?

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at
    RE: validation on sales invoice creation

    Hi,

    There are quite number of ways to acheive this. One way is to introduce the below validation code in createParmLine(After line# 163) method of class SalesFormLetterParmData.

    this.insertParmLine(localSalesParmLine);

               lineCreated = true;

    // Use this code

    if ((this.parmDocumentStatus() == DocumentStatus::Invoice) && (localSalesParmLine.salesPrice() == 0))

    {

                   warning(strFmt("Line price is zero for item: %1",  localSalesParmLine.ItemId));

    }

    With this approach a warning appears for all the selected lines on opening of Posting invoice form and if none of the lines gets selected for invoice then no warning appears.

    Hope this helps you.

    Thanks,

    Chaitanya Golla

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: validation on sales invoice creation

    Hi selva,

    Unit price refers to the cost or the sales price in your case?

    Best regards,

    Ludwig

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#1
Guy Terry Profile Picture

Guy Terry 2 Moderator

#1
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans