Home » Developer & Programmer » Forms » Only numbers are allowed (Forms [32 Bit] Version 6.0.8.12.1)
Only numbers are allowed [message #679683] Mon, 16 March 2020 10:39 Go to next message
hercules27
Messages: 9
Registered: January 2013
Location: Athens
Junior Member
Hello,

I have a form with some criteria fields and a detail block (tabular) with results. (only query and search like an Lov )
I want one criteria field ( eg. phone_number) to accept only numbers and the characters _ and % (for wildcard searching)
That is, if a user inputs as a phone number 595A and clicks Find, he gets a message that only numbers are allowed.
But if he gives 28_59% to play. So only numbers and characters % and _ are allowed. How to inform the user that only numbers and characters % and _ are allowed?

By the way, when the user clicks Find, I have made a query procedure in the database like


FROM TELEPHONE_CATALOG T

WHERE TO_CHAR( T.PHONE_NO) LIKE '%'||P_PHONE_NO||'%'


Thank you.

Note:
This is actually a form that is used like a List of Values, when the user presses F9. Instead of making a record group with select statement, and an LOV ... and so on.
I call another form, which has some criteria and a tabular detail block with results. The detail block is based on a procedure, specifically a package with a query procedure. These are the standards that the company follows for all LOVS.

So although I may disagree, I must comply with these standards.
Re: Only numbers are allowed [message #679685 is a reply to message #679683] Tue, 17 March 2020 02:26 Go to previous messageGo to next message
hercules27
Messages: 9
Registered: January 2013
Location: Athens
Junior Member
I found it ok
Re: Only numbers are allowed [message #679686 is a reply to message #679685] Tue, 17 March 2020 02:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

So post the solution.

Re: Only numbers are allowed [message #679698 is a reply to message #679686] Tue, 17 March 2020 10:30 Go to previous message
hercules27
Messages: 9
Registered: January 2013
Location: Athens
Junior Member
IF translate(:CRITERIA.F_phone_NO,'x0123456789_%','x') IS NOT NULL THEN
message....

RAISE FORM_TRIGGER_FAILURE;
END IF;
Previous Topic: About ignore record when commit
Next Topic: Duplication Occurred. Verify the entry. - Forms message issue
Goto Forum:
  


Current Time: Thu Mar 28 14:39:15 CDT 2024