Home » Developer & Programmer » Forms » when-validate trigger
when-validate trigger [message #599647] Sun, 27 October 2013 23:56 Go to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi All,

Can any one please help me on "When−Validate−Item trigger of the ENAME text item that checks for null values and invalid characters"

I want code please help me!

Thanks&Regards.
Surya
Re: when-validate trigger [message #599648 is a reply to message #599647] Mon, 28 October 2013 00:59 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
For Null values: make the item mandatory.
For invalid characters: what characters are "invalid"?

What do you have so far?

MHE
Re: when-validate trigger [message #599654 is a reply to message #599648] Mon, 28 October 2013 01:14 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi Maaher,

Thanks for reply, Quote:
For invalid characters: what characters are "invalid"?


Means that name of the employee and if u have code on that trigger related to, please please send me

Thanks
Re: when-validate trigger [message #599655 is a reply to message #599654] Mon, 28 October 2013 01:16 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, that doesn't answer the question, I'm afraid. Let me try to explain it: which employee names are valid, and which are not and why:
- mist598
- Littlefoot
- 225336
- 1_34/Mike
Re: when-validate trigger [message #599657 is a reply to message #599655] Mon, 28 October 2013 01:25 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi Littlefoot,

I thought it checks employee name valid or not Is this not possible invalid characters write on WVT? Could you please explain?

Regards,
Mist
Re: when-validate trigger [message #599660 is a reply to message #599657] Mon, 28 October 2013 01:31 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
It is possible to validate fields in the WHEN-VALIDATE-ITEM trigger (look at the name of the trigger). But you still didn't answer the question: what characters do you consider valid or invalid? We cannot help you out without the proper requirements.

MHE
Re: when-validate trigger [message #599661 is a reply to message #599660] Mon, 28 October 2013 01:35 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Valid characters only consider.

For example
ENAME: SCOTT not enter scott in small letters
.So, is this possible to me?

Re: when-validate trigger [message #599663 is a reply to message #599661] Mon, 28 October 2013 01:41 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
There's a property for that too, I believe: Case restriction (is that correct, @Littlefoot? I'm flying blind here). If I can solve it without coding, I do so.

MHE

Edit: so you don't need a trigger after all. Just set the proper properties.

[Updated on: Mon, 28 October 2013 01:41]

Report message to a moderator

Re: when-validate trigger [message #599664 is a reply to message #599663] Mon, 28 October 2013 01:45 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi Maaher,

Ok thanks and Can use ASCII function to check if it is not between 65 to 90
Re: when-validate trigger [message #599665 is a reply to message #599664] Mon, 28 October 2013 01:51 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
If you want to, why not. But have you read my previous reply? Why write a trigger if Forms has properties you can use? You're just making it difficult for yourself. And to be honest, if you ask questions like these perhaps it's better to keep coding to a minimum (no offence intended).

MHE
Re: when-validate trigger [message #599667 is a reply to message #599665] Mon, 28 October 2013 01:54 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Thanks Maaher,

Thanks for helping me.

Regards,
Mist
Re: when-validate trigger [message #599671 is a reply to message #599667] Mon, 28 October 2013 02:15 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Maaher

There's a property for that too, I believe: Case restriction

Correct! If you (mist598) set it to "Upper", you don't have to write any code.

However, if you want to check whether data entered into that item contains ASCII letters only, try with a regular expression function. You didn't specify Forms version you use; if it is 6i, I believe that you can't do that in Forms - you'll have to create a stored (database) function and call it from a form. Here's an example of the regular expression you might be interested in:
SQL> with test as
  2    (select 'mist598' col from dual union
  3     select 'Littlefoot'  from dual union
  4     select '225336'      from dual union
  5     select '1_34/Mike'   from dual union
  6     select 'MAAHER'      from dual
  7    )
  8  select col
  9  from test
 10  where regexp_like (col, '^[[:alpha:]]+$');

COL
----------
Littlefoot
MAAHER

SQL>

("Littlefoot" is here; if you set the "Case restriction" property, you won't be able to enter mixed case anyway and worry about it in that function).
Re: when-validate trigger [message #599677 is a reply to message #599671] Mon, 28 October 2013 02:22 Go to previous message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Thanks Littlefoot,

Giving me a best example and i will try to create function and catch u later!
Previous Topic: passing check box values to WHERE clause
Next Topic: Reading data from excel file and load into forms
Goto Forum:
  


Current Time: Sun May 19 11:20:48 CDT 2024