ValuesAllowed Property - Allow a Blank

IrishGiriIrishGiri Member Posts: 61
I would like to allow the following values/text strings (frequencies)as input to a textbox:

40.685;26.995/27.195;27.145/40.685;446.000;49.860

When I put this string in the ValuesAllowed property of the textbox it works perfectly.

However, if at a later stage the user decides to delete the frequecncy I will have to allow for this too i.e. I need to add one more value to the string above to allow a blank value ('').

I have exhausted all possibilities to add a blank option to the string above...Navision won't accept a blank? Does anybody know how to do this?

Thanks, Paul.

Comments

  • Abu_FalihahAbu_Falihah Member Posts: 3
    You mean you put them in the property ValuesAllowed? If this the case, just add , (comma) before your first value.. Hope it solves
  • IrishGiriIrishGiri Member Posts: 61
    No good I'm afraid. Says:
    '' is not a valid value
    

    Then I try putting '';40.685;26.995/27.195;27.145/40.685;446.000;49.860
    and that doesn't work either.

    Seems also you have to use semicolons not commas to separate values
  • Abu_FalihahAbu_Falihah Member Posts: 3
    Hi,

    Try to put comma instead of semi colon to separate the value in your textbox's property. By the way, I use Nav 4.0 SP3.
  • IrishGiriIrishGiri Member Posts: 61
    No good again I'm afraid!

    Using commas doesn't work..Inputting 49.860 you get an error:

    '49.860' is not a valid value. The following values can be used: 40.685,26.995/27.195,27.145/40.685,446.000,49.860.

    It works with a semi-colon separated list. I just can't get it to work by adding a blank or empty string value to the ValuesAllowed string.
  • mart1n0mart1n0 Member Posts: 123
    To what is the NotBlank property set, it should be set to No?
  • IrishGiriIrishGiri Member Posts: 61
    NotBlank is set to No
  • IrishGiriIrishGiri Member Posts: 61
    Frankly, problems like this I find very annoying....should really call this property SomeValuesAllowed !! ](*,)
  • IrishGiriIrishGiri Member Posts: 61
    And I do not want to creat an option field before anyone suggests tis haha! O:)
  • VineethVineeth Member Posts: 4
    hai irish,

    i m waiting for an answer as well for ur question.

    Well what if we dont enter any value to that field..wont it take the value as blank??? well i m just a beginner in Navision.

    regards
  • IrishGiriIrishGiri Member Posts: 61
    Yes it's not a problem in the beginning but.....


    However, if at a later stage the user decides to delete the frequecncy I will have to allow for this too i.e. I need to add one more value to the string above to allow a blank value ('').

  • Abu_FalihahAbu_Falihah Member Posts: 3
    OK try this one, you put it like this:

    "40.685","26.995/27.195","27.145/40.685","446.000","49.860."

    But then you must use EVALUATE() if you want to use this value as Integer or Decimal.
  • kinekine Member Posts: 12,562
    And why you do not use C/AL code in OnValidate of he field to restrict the values you can enter?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.