maxvalue by code

did36did36 Member Posts: 25
is it possible to modify maxvalue in a form (or table) by code?

thanks

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    I know it's possible with minvalue.
    So probably with maxvalue too. Yep, it is also possible by code. Just tested it.
    If maxvalue is 5, you can enter Value := 10 in code.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • did36did36 Member Posts: 25
    I'm test :
    CurrForm."Line Discount %".maxvalue:=10;
    and
    CurrForm."Line Discount %".maxvalue(10);

    but it don't work
  • tinoruijstinoruijs Member Posts: 1,226
    Sorry. I misunderstood you.
    That's not possible.
    There aren't much properties in NAV which you can modify by code.. :(

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • did36did36 Member Posts: 25
    thanks
  • tinoruijstinoruijs Member Posts: 1,226
    Sorry. I misunderstood you.
    That's not possible.
    There aren't much properties in NAV which you can modify by code.. :(

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • MalajloMalajlo Member Posts: 294
    what about onValidate trigger?
  • did36did36 Member Posts: 25
    Yes, I can do with code on onvalidate, but my question is it's possibble to manage maxvalue By code
  • deurgesdeurges Member Posts: 8
    Yes, of course.
    for example:
    Line Discount % - OnAfterValidate()
    IF "Line Discount %" > 10 THEN
      ERROR('...');
    
  • SavatageSavatage Member Posts: 7,142
    if your thinking of setting a set value like "10" i wold suggest adding a field to the sales setup caled Max Discount allowed. there you can store your number and be able to change it easily if needed.

    Line Discount % - OnAfterValidate()
    Salessetup.GET;
    IF "Line Discount %" > Salessetup."Max Discount Allowed" THEN
    ERROR('...');
Sign In or Register to comment.