It would be convenient to be able to paste prices from a website where the formatting contains spaces.
Example: 15 795,06 (fifteen thousand seven hundred ninety five and six cents).
The problem is that the thousand separator is a space character, which the number attribute doesn't allow. If you try to paste the number, the field remains empty and you will see a circled exclamation mark icon to indicate that the input was not allowed, similarly to if you would try to type a letter. It needs to be a number attribute because I make calculations.

15795,06 = works
15 795,06 = doesn't work

While the config tool allows you to specify locale "culture", as well as number formatting, it does not seem to help in this case.
Yes, it is possible to make the thousand separator work if you use a custom number format and manually type the number and then click outside the number field. Then it will add the space once the field loses focus. But copy pasting with a space is still not possible unfortunately.

I have hopes that JS might be a solution, but I am not sure where to start digging. I would like to try and avoid to have an extra attribute and business update rules to do the conversion if possible.

Ask ChatGPT this exact question and say that it is for AwareIM and ChatGPT will give you a couple of solutions (I already did it and saw the solutions).

This is the thing with ChatGPT. Sometimes it produces code that is aesthetically pleasing, but doesn't actually work. Did you try any of the code it generated for you?

I spent a lot of time trying to achieve this via ChatGPT, but no cigar.
I generated and tested so much code, and it seems like the copy paste validator was impossible to bypass.

  • Edited

Since I don't need that many attributes for price data, I decided to go with the extra attribute and search/replace solution:

PriceUserInput = Text attribute (only exists to hold the clipboard data and do the conversion)
Price = Number attribute

BO update rule:

/*search replace to remove spaces and convert commas to dots*/
If BO.PriceUserInput WAS CHANGED Then
BO.Price=AS_NUMBER(REPLACE_PATTERN(REPLACE_PATTERN(BO.PriceUserInput,',','.'),' ',''))

Still interested to hear if anyone knows how to modify the kendo behavior because it might be useful in the future.

5 days later

I didn't test the solutions no but I have gotten many other code snippets etc. from ChatGPT that worked either as is or after some minor modifications. Usually when I get an error actually I have ChatGPT troubleshoot it i.e I tell ChatGPT what I did and what happened e.g potential error message etc. and ChatGPT then give me another modified script etc. and I go back and forth until it works. It really is remarkable how much of a help ChatGPT/AI can be for small tasks and troubleshooting like this and will be great when Awaresoft release their own AI "assistant" that I assume also can help with things like this.