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 stop dialogue box

(0) ShareShare
ReportReport
Posted on by 495

Hello Experts, am back it again with AX 2012....

I have a situation where for some reason items are coming out with unit price a 0.00. on the sales order line. Now I have a requirement to ensure this doesnt happen. Is there a way to put a stop dialogue box on a sales order line if an item price is 0.00? This is to prompt the user that they need to call Sys Admin to before they can confirm the order. All suggestions help is greatly appreciated.

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    In the sales confirmation class there is a validate method. you can customize that if you are in AX2012. for D365 you can extend that using post event handler or using COC

  • Lionel07 Profile Picture
    495 on at

    Hello Sohaib, thanks for you response.... are you referring to the class SalesConfirmJournalCreate class? I have search most of the classes and cannot seem to find tha validate method to which you speak.  I am using AX 2012 R2

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    My apologies for not having a look of the AOT.

    Can you see there a method named checkDiscardLines..?

    Also it should allow you to override check method.

  • Lionel07 Profile Picture
    495 on at

    Yes that is there but when I added the calidation code, confiormaton is still printing

    if (salesParmLine.LineAmount<= 0)

       {

           return true;

       }

       // LF CODE TO CHECK LINE AMOUNT

       if (saleslines.salesPrice <= 0)

       {

           return true;

       }

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    You are returning True which seems doubtful to me, though i can be wrong here. Can you please try something as under?

    If(saleslines.salesPrice)

    {

      return checkFailed('Any message that you may want to display.');

    }

    Also note that you may take care for case of Return Orders in your IF condition.

  • Lionel07 Profile Picture
    495 on at

    Thanks much Sohaib, this is very complicated stuff besides am only started learning to code in AX.  I have sorted it our without having to write code but now am in a another problem. My solution works for the sales order but for the sales agreement am having serious problems. Could you be so kind in helping me find where i can drop some code or modify some methods to ensure all values entered in the unit price for a sales agreement is more than 0.00? i have to do this for the sales agreement because user enter the unit price manually. Now I only need some help in figuring out how to get to validate the control (ALine_AgreementLineQuantityCommitment).PricePerUnit so that a value greater than 0.00 is always entered.  

    Am not even seeing the table (ALine_AgreementLineQuantityCommitment) in AX

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