[Input Masks Library] 'Currency expected' when input mask is applied
Forge component by Labs
Application Type
Reactive

When we trigger built-in validations on a form that has input-mask wrapped fields, we get unexpected validation errors on fields that are valid. To demonstrate the issue, we have set up a project with 2 currency attributes where one is wrapped in a mask and one is not wrapped:

Attached the OML of the demo project.

Is there any explanation and solution for this issue?

[EDIT] The issue is worked around by turning the Input Type of the input field into Text. However, the values are stored as currencies. Would the best way to use this component be to have local text variables that are filled by conversion, or just to live with the warnings in Service Studio?

InputMaskDemo.oml

I'm having the same issue, but change to text didn't help me.

Hi Thiago, 

Yeah pretty interesting issue this. The work around of changing to 'Text' does stop the error from showing. Please see the field that needs to be changed in the screenshot below.

Hello Remco, Thiago,

So I have found the root cause and the behavior you are encountering is at least 'by design' when it comes to the built in validations.

When you set the 'Currency' local variable to Data Type 'Currency' OutSystems does not allow commas any more. I confirmed this by trying to set the Default Value to 10,000. As you see below it gives me a syntax error about the unexpected ','.

So the ideal way at this point seems to be to set both the Input field and its associated local variable 'Currency' to data type 'Text'. Hope this helps. At least we now know why you were getting the validation message!

Regards

AJ

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.