[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

oracle forms question

I have a code in a free txt field called comments
and the code is

If :open_reason is null then
      msgbox.show('Reason', 'Reason to Re-Open cannot be Null. Please verify re-enter.', 'OK');
      go_item('open_reason');
      raise form_trigger_failure;
Else
     go_item('emp_validation.emp_id');
     hide_window('open_reason');
End if;
------------The user is just tabbing or entering a space and are able to exit. How can I prevent?
0
anumoses
Asked:
anumoses
  • 6
  • 2
  • 2
2 Solutions
 
slightwv (䄆 Netminder) Commented:
Try this:

If trim(:open_reason) is null then
...
0
 
anumosesAuthor Commented:
It did not work. I did a return carriage {enter} key and was able to exit
0
 
JacobfwCommented:
What trigger are you putting this code in?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
slightwv (䄆 Netminder) Commented:
With 9i your options are pretty limited.

What are your 'allowable' characters?

For example can someone exit with a single | character?
0
 
anumosesAuthor Commented:
What trigger are you putting this code in?

When-button-pressed trigger

For example can someone exit with a single | character?

yes. They are able to exit
0
 
anumosesAuthor Commented:
I tried this

select dump(open_reason), open_reason from qc_daily_confirmations
where trunc(CREATE_TIME) = trunc(sysdate)

DUMP(OPEN_REASON)|OPEN_REASON
Typ=1 Len=1: 10|

Its a return carriage I used to exit out
0
 
anumosesAuthor Commented:
I also tried in my code using

replace(replace(:open_reason,chr(10),' '),chr(13),' ');

did not help
0
 
JacobfwCommented:
when-button-pressed?

if you are attempting to validate a free form field with entry, you should be using the When-validate-item
0
 
anumosesAuthor Commented:
I got a function from oracle forums. Its works for me

CREATE OR REPLACE FUNCTION strip_bad (p_string IN VARCHAR2)
      RETURN VARCHAR2
    IS
       good_string VARCHAR2(62)
          := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ||
             'abcdefghijklmnopqrstuvwxyz' ||
             '1234567890';
    BEGIN
      RETURN
       TRANSLATE (p_string, 'T' ||
                              TRANSLATE ( p_string, '.' || good_string
                                                 ,  '.'
                                       ) -- find the bad characters
                         ,  'T');  -- remove the bad characters
  END;

--------------------
select strip_bad('0110.-()*"'||chr(10)||'~!@#$%^&*()|') as strip_bad from dual;

STRIP_BAD
0110
0
 
anumosesAuthor Commented:
thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now