Skip to Content
avatar image
Former Member

Number Format Mask Question

Hi guys, i´m trying to use a number mask because I want to set a mask from a number field, in other way I don´t want to change the type of the field to text because I expect always numbers and in VC I can´t found the way to validate with regex.

So, the problem is when I set the mask in the value field, it´s turn automatically to read-only, so at runtime the user can´t set a value and then makes the system format it.

How the format thing works in VC !?

Is the right place to use the format functions !?

Any help will be appreciated.

2.jpg (39.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 18, 2014 at 08:09 PM

    Hi Isaac,

    When you set the mask in the value field, it´s turn automatically to read-only.

    The reason this happens is since the calculated field you define is

    treated as text, because it does not have a matching "real" field in the

    data set.

    Where does the value of field @FacturaSAP come from?

    Does it comes from a service?

    If so, you can do the following:

    1. Drag a "Data Share" (lets call it share1) element from the "Compose" panel. Connect the output port of the service to it.
    2. Open Define Data dialog of share1
    3. Add two new fields:

              TXT1 (text field)

              NUM1 (numeric field)

       4. Open Map Data dialog of the mapping line between the output of the service and the share1

        5.     Define the Assign values of the new fields as following:


    TXT1       =NSTR(@FacturaSAP ,"<ANYMASK>")

    NUM1   =NVAL(share1@TXT1)

    6. Create some UI element (FormView or GridView) using quick link from share1. This UI element will contain the InputField that will be bound to NUM1 and will display the number in the needed formatting.

    I attached a screenshot of model example for your reference. There is another mask in the example, but in does not matter in this case.

    Hope it helps.

    If the value of field @FacturaSAP does not come from a service, please attach a screenshot with the model and brief explanation of the use case.

    Thanks,

    Talia


    Formatting.jpg (133.5 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Hi Isaac,

      The solution of formatting in the mapping will be good if the values come from a service.

      In your case the formatting of numbers is done automatically per current locale.

      I am not sure there is a way to overcome it.

      Thanks,

      Talia

  • Jun 19, 2014 at 11:27 AM

    Hi Isaak,

    you have to set the currency not IN the input field, but beside the input field you can make a further input field for the currency.

    If you want your number without formating of the number you have to use text fields otherwise it will be formated.

    My problem is and maybe Talia can help me:

    I want to format my table column so, that I see always one decimal place and it should be sortable.

    Do you have for this issue any idea?

    BR,

    Murat Y.


    Add comment
    10|10000 characters needed characters exceeded