I have setup caller ID using a USB modem the same way as for many other setups I’ve done, however on this one the number is being formatted differently by the phone company, like this
01234-567890
I want to remove the -
from the number before passing to the entity screen, so that the number is saved as
01234567890
Normally I would’t care as much, but we have integration with GloriaFood on this same setup as well as loyalty cards linked to the customers, therefore if we have numbers coming in for phone orders with -
and online orders without, we are going to get duplicate customers and problems with our loyalty setup.
Since we can match the phone number correctly coming from the modem, we just need to remove the -
before it is sent to the entity screen. The “Search Format” field seems to be the obvious place to try things:
I have tried regular expressions and various other things, some do nothing, others crash SambaPOS. The only thing I can get to work in this field is {0}
which of course just passes the number as is. So it looks like the field only lets you do things like prefix / suffix, etc., e.g. ABC {0} DEF
.
I can’t find anything solid about this field on the forum. I searched online using some info from one of the errors I got when SambaPOS crashed and found information about C# handling of formatted strings, which it appears this is. However if following the info on that site, I should be able to either use {0:N}
or {0:###########}
to format the number without the -
(the first forces it to a number, the second forces each character to a digit). However, neither work - they don’t throw any error but they just display the number with no change.
I then looked at the Entity Screen, specifically the “Search Value Replace Pattern”, which I assume needs to be a regular expression.
I have tried a few but can’t get anything to work, it is like it does nothing. There is again no info on the forum about this field.
Does anyone have any suggestions what I can do here? Or what values I could possibly try in those fields?
Thanks!