Options

checking a value

redStriperedStripe Member Posts: 83
Hello together,
I try to check a input into a table via a card...
e.g. I have a field on a card... when I change the value of the field
fom "8" to "4" I want to start a function that validate the input.
the function should compare the new value "4" with a value from a special
table. If the new value "4" is not valid than the function should show an error message.
The problem is, that I always get the old value "8" and not the new "4" for the comparison. I thought Navision saves a value after I pressed enter, but
in the table is still the old value "8"

I hope somebody understand my problem ... it was a long hard day today :cry:

redStripe

Comments

  • Options
    DenSterDenSter Member Posts: 8,304
    The function that you wrote probably has a parameter that you use to send in the field value. Go into the locals for that function and put a check in the VAR checkbox. This means that the parameter is by reference, and if the function changes the parameter value, it will retain that new value in the object that calls the function.
  • Options
    jmjm Member Posts: 156
    Hi,

    are "8" and "4" values of the primary key of your special table?

    if Yes:
    define a table ralation between your input field and your special table.

    hth
    Josef Metz
    br
    Josef Metz
  • Options
    kinekine Member Posts: 12,562
    redStripe wrote:
    Hello together,
    when I change the value of the field
    fom "8" to "4" I want to start a function that validate the input.
    the function should compare the new value "4" with a value from a special
    table. If the new value "4" is not valid than the function should show an error message.

    For me it seems that you want to add code into OnValidate trigger of the field or edit box (text box) and call function which compare the function. But you did not wrote in which trigger you entered the code. Pls, can you post your code which is not working? There must be some trivial mistake, because this is base functionality of Navision (validating values).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.