Phone Number Mask on Query

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 171
Joined: Wed Apr 22, 2015 11:44 pm

Phone Number Mask on Query

Post by Jhstephenson »

I have a phone # attribute in one of my BO's. On the Main form I have the presentation set to mask it to look just like an American phone number "(999) 000-0000", but I am not storing the mask as part of the attribute.

That is working just fine.

Now when I put that phone number attribute on a query I cannot get it to display it with the phone number mask.

Is there some trick to doing that?

I have tried putting a format of (999) 000-0000 in the Display Format for the Column Settings and unchecking the "Use style defined in the attributes...." setting, but that does nothing.

I have defined a presentation rule in the attribute settings, but that does nothing.

What am I missing?

Thanks,
Jim
Jaymer
Posts: 1754
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Phone Number Mask on Query

Post by Jaymer »

Jim
magic was much easier to format #s for display, so in Magic I'd always store the raw 10-digits.

In Aware, I've changed to always store it WITH the dashes/formatting. I generally use (813) 555-1212
No downside.
Plenty of upside.

J
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jhstephenson
Posts: 171
Joined: Wed Apr 22, 2015 11:44 pm

Re: Phone Number Mask on Query

Post by Jhstephenson »

Yeah, I know, Jaymer.

We have had that discussion here in the office.

The only problem is that in this particular application we are actually moving data back and forth between a Magic App and this Aware App. So, I need to keep it as generic as possible.

Jim
Jaymer
Posts: 1754
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Phone Number Mask on Query

Post by Jaymer »

well, strike 1 for me.

i've done what you're trying to do regularly on datetime fields and the format changes correctly.
But I just spent 20 mins on this text field and can't waste anymore. Too frustrating.

A Numeric column will respect a manually typed in Display Format.
but a Plain Text column will ignore the Display Format - as we both have now proven on a phone # format.
Probably because what we are used to using like "000-000-0000" is not really a display format, but like it says, an input mask.
So its for an input field only.

So, I'd create a 2nd field for display and use that.
Or, use the annoying "calulated field in a grid" which has always seemed dodgy. And you can't filter on it.

J
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
eagles9999
Posts: 2173
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Phone Number Mask on Query

Post by eagles9999 »

Make sure the Attribute is min 20 characters long otherwise it won't work.
Cheers,
Mark
_________________
AwareIM 6.0, 8.4, 8.5b (build 2806) MS SQL Server 2012 / MariaDB, Windows 10, Ubuntu Linux, Theme: Default, Browser: Chrome
Upcloud, AWS
Image
Jhstephenson
Posts: 171
Joined: Wed Apr 22, 2015 11:44 pm

Re: Phone Number Mask on Query

Post by Jhstephenson »

Mark, it is already set to 20 characters.

Jaymer, the storage miser in me just doesn't want to create a duplicate field just to handle something like this. And to be honest something like that should never be necessary.
PointsWell
Posts: 977
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Phone Number Mask on Query

Post by PointsWell »

This is a pain especially if a user thinks they have keyed in in the correct format but then the mask is stripped in queries.

This was raised this as a feature request here https://awareim.com/forum/viewtopic.php?p=53724#p53724

Saving the mask is also not a great work around as the format then becomes part of the record and searches then require the mask to be included.

I have the same issue but with bar codes which have specific input masks depending on the barcode length.
Post Reply