Home » Developer & Programmer » Forms » problem with when-validate-item (Forms 6i)
problem with when-validate-item [message #401766] Wed, 06 May 2009 06:52 Go to next message
Nincy666
Messages: 5
Registered: May 2009
Junior Member
For example : I have 4 items (A,B,C,D) on a form. A and B have when-validate-trigger ,they have initial value and they are required. Validation trigger of item A set value of item C on 5 and validation trigger of item B set value of item D on 6.

If you skip items B and C (if you don't click it with mouse ) and you place mouse pointer directly into D, only trigger of first item (A) fires and set value of item C on 5. If you insert value 7 into D and than commit form , forms fires validation of item B and change value of D on 6. (validation unit = default)

How can I force when-validate-triggers of item (B) at time I skip it (before commit form)? Any idea ?

On ''real'' form i have more items which can user skip with mouse, but trigger must fires before commit form.
Re: problem with when-validate-item [message #401788 is a reply to message #401766] Wed, 06 May 2009 07:34 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
you can't
icon5.gif  Re: problem with when-validate-item [message #401836 is a reply to message #401788] Wed, 06 May 2009 11:04 Go to previous messageGo to next message
Nincy666
Messages: 5
Registered: May 2009
Junior Member
cookiemonster wrote on Wed, 06 May 2009 14:34
you can't


Any workaround ?

Thanks,
N
Re: problem with when-validate-item [message #401839 is a reply to message #401836] Wed, 06 May 2009 11:13 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Hi,

if you always wants to set the value of eg: D to 7 then do it in pre-insert.

if you want you can do like..

if D is null then
d:=7;
end if;



Re: problem with when-validate-item [message #401841 is a reply to message #401836] Wed, 06 May 2009 11:20 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Nincy666 wrote on Wed, 06 May 2009 17:04
cookiemonster wrote on Wed, 06 May 2009 14:34
you can't


Any workaround ?




To what?
The trigger not firing moment you bypass an item? - no
A more general issue? - maybe

What are you trying to achieve here?
Re: problem with when-validate-item [message #401843 is a reply to message #401839] Wed, 06 May 2009 11:22 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
klat wrote on Wed, 06 May 2009 17:13
Hi,

if you always wants to set the value of eg: D to 7 then do it in pre-insert.

if you want you can do like..

if D is null then
d:=7;
end if;



Since when-validate-item will always fire before pre-insert I doubt that's going to be much help.
Re: problem with when-validate-item [message #401849 is a reply to message #401843] Wed, 06 May 2009 11:37 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
This is not a code issue. D can't depend on two different rules
(set by WVI and set by the user). To resolve this problem, we can say :
1)D is set by WVI if D is null else D.
OR
2) D can't be set by user so make it protected against update.

But One things is clear : When commit_form WVI fires.
Re: problem with when-validate-item [message #401854 is a reply to message #401849] Wed, 06 May 2009 12:17 Go to previous messageGo to next message
Nincy666
Messages: 5
Registered: May 2009
Junior Member
Thanks for your answers !

I want to offer user the values based on few items . I gave the simple example , that i easier described the problem.

User can change this offer values and if he changed them i don't want that forms overwrites it by commit_form by firing validation triggers of skipped items.

[Updated on: Wed, 06 May 2009 12:21]

Report message to a moderator

Re: problem with when-validate-item [message #401973 is a reply to message #401854] Thu, 07 May 2009 03:12 Go to previous messageGo to next message
Nincy666
Messages: 5
Registered: May 2009
Junior Member
I used when-mouse-down trigger on item C:


Quote:
validate(form_scope)



but this code firing when-validate-trigger of all items (also D) , what i don't want. Any other idea ?

For your answers I will very grateful
Re: problem with when-validate-item [message #402049 is a reply to message #401766] Thu, 07 May 2009 07:27 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
I wouldn't try and use mouse triggers for this, it'll just make matters even more complicated.

Why can't you just, as TonyJaa suggested, change the WVI triggers to only populate C and D if they are NULL?

Actually, does the default value of D vary with the value of B?

If it does then there's nothing you can do about D untill the user has entered a value in B anyway.

If not - why not just use a When-Create-Record Trigger?
Previous Topic: FoReDoclet
Next Topic: can i read the value of client session in to the code in 10g
Goto Forum:
  


Current Time: Fri Sep 20 10:29:30 CDT 2024