Hi,
I have one question about this scenario:
I have an input field that using currency input mask for ', ' separator and decimal place. It works well but there is an issue if i need to reset the value of the input field to 0 after validation check negative number. I want to make it back to 0 after validate the negative number but the value displayed on input field does not reset and remain the same . The input field use onChange event to trigger validation for negative number.
I hope there is a solution for this.
Thank you
Hi Aqil,
I went through your oml and found solution. You just need to set your Currency variable data type to text instead of decimal and it works same as you were using it for decimal variable and also reset variable to 0 if entered number is negative.
I have attached working OML herewith.
and here is the reference link of the demo:
https://shweta-gedam.outsystemscloud.com/InputMaskSample/InputTest?_ts=637442639333746161
Hope it works now, Thanks and Happy Coding!!
You have to only assign variable(currency)=0.
Hope this helps.
thanks,
Samiksha
Sorry my bad, actually im using another forge which is InputMaskReact > MaskCurrency and already put assign node to set 0..but still not working.
may be it is due to variable data type. if variable data type is decimal then assign 0.0, if text then "", and integer then 0.
please try and let me know.
Hi sorry to bother, but for my case, the variable can't be change to data type = text due to the variable is coming from aggregate (database).. so any solution due to this?
HI Aqil,
Are you using any prefix like '$' for currency Input and also what is the data type of your input field in Input type properties and variable?
Hi Shweta, not using any prefix for now and data type is Number for the input field. I found out that if input value is set to other value than 0 it will display the new value. Maybe it is because 0 is a default value and by default the input field will be empty?
Could you please share OML for the same?
Please find the attached OML file for your review
Thanks
Hi Shweta,
It works now..Thanks!
That's great, Happy Coding!!