PopUp Message while creating a new product (Beginner)

heynemheynem Member Posts: 13
edited 2005-08-25 in Navision Attain
Hi everybody,
I am quite new in programming Navision. Therefore my question seems a little bit stupid :(
I want to apply the following changes during the process of creating new productcodes. I want that the user go direct in the field (with TAB) which should be next. I have sort this out with the option "NextControl". But I want also in the field "EAN" that the user get a PopUp when the field is empty => "are your sure there is no EAN code ??"

Can somebody tell me where I need to place what kind of Code ???

Thank you very much in advance for your support



  • Timo_LässerTimo_Lässer Member Posts: 481
    The best position for your code should be the OnAfterValidate-Trigger.

    Rough and dirty code:
    IF EAN = '' THEN
      IF NOT CONFIRM('Are your sure there is no EAN code?',FALSE) THEN
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • jhoekjhoek Member Posts: 216
    Are you sure you want to do this? It's not really the Navision-style of handling data entry errors. Please take a closer look at the base application and reconsider! :wink:
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • DenSterDenSter Member Posts: 8,304
    Make sure that this code only runs when you're on a form. You do not want to have popup messages in automated processes, and by inserting this type of code in the OnValidate, you will have the message everywhere that the field is validated.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262

    Best is, as Jan said, to do this Navision style,

    Navision checks at 2 places mostly

    1). If the item is used in e.g. a salesorder or purchase order. You can use TESTFIELD(EANCODE) in Table 37

    2). When posting in e.g. codeunit 80, or 22! just retest the EAN code.

    For some customers is takes getting used to, but after a while they get used to it.
Sign In or Register to comment.