Hiding Confirmation/Messages

madmmadm Member Posts: 92
edited 2006-08-28 in Navision Attain
when entering a sales order, there is a function which is called from the insert/modify section of the table which prompts the user to (not) accept changes. this works fine.

however, when changing the delivery dates etc on the header, then this also updates the lines. Of course, this then reasks the questions all over again!

I there anyway hide this sales line prompts (not the delivery date - update line message), which have been originally answered (eg the user chooses NO at this stage to keep the line as it was).

If i remove the trigger from the on modify, then this does cure it, however, if the line needed to directly modified then of course the function isnt called!!

Comments

  • ara3nara3n Member Posts: 9,256
    Add it to the onvalidate of the field. add your code to something like this
    if xrec."Your field" <> "Your field" then
      if not confirm('are you sure you want to do this?') then
       error('action canceled');
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • madmmadm Member Posts: 92
    thanks for that..

    just to clarify :

    if i remove the call from insert/modify to the on validate field of the sline..

    as the confirmations are within the function, would this be ok?

    am i correct, in thinking xrec basically copies the current value in that field?

    if xrec."Your field" <> "Your field" then
    function
  • ara3nara3n Member Posts: 9,256
    yes you can move it to a function. Xrec is the value of the record before the field is populated. So you the if statement checks and makes sures the value has changed and then gives the confirm message.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • madmmadm Member Posts: 92
    A wet sunday afternoon, so what other way to spend it ;)

    i have been playing in a test environment, and found leaving everything as it was, but adding

    if xrec.quantity = quantity then
    exit

    to the beginning of the function appears to have cured it..

    should it have been that easy?!

    edit : my vpn had blocked my local internet access, so my page hadnt updated, thus not seeing your reply :)
  • madmmadm Member Posts: 92
    thought about a situation, we may be affected..

    if we directly change the quantity on the line, then of course the function isnt going to be called which is required..

    think i have some more playing to do!

    :D
Sign In or Register to comment.