Home » Developer & Programmer » Forms » move cursor (next item) to a text item lower in sequence (merged 3)
move cursor (next item) to a text item lower in sequence (merged 3) [message #411226] Thu, 02 July 2009 09:57 Go to next message
tuckersuz
Messages: 26
Registered: July 2009
Junior Member
I have a when_validate_item trigger for one of my text items which refers to three previous text item conditions in the code. I have a raise form_trigger_failure at the end, to keep the cursor at that field, so the user cannot move to another field until the correction is made, but I would like the cursor to move to a text item that is above (or earlier in the sequence) than item where the when_validate_item code is.
example:
if (item1 is null) (first in sequence)
and (item2 in 'xxxxx') (5th in sequence)
and (item3 is not null) (7th in sequence) then
message('must enter [value for item1] when item3 is not null');
raise form_trigger_failure;
end if;
end;
I would like the cursor to go BACK to item1, so the user can make the change, instead of resting at item3, where the when_validate_item code is. I know the raise form_trigger_failure is keeping the cursor at item three, since that is where the when_validate_item code is, but I can change that if I can move the cursor to item1, so the user can make the change.
How can I do this?

Many thanks
move cursor (next item) to a text item lower in sequence [message #411227 is a reply to message #411226] Thu, 02 July 2009 10:03 Go to previous messageGo to next message
tuckersuz
Messages: 26
Registered: July 2009
Junior Member
How can I move a cursor to an item in an earlier sequence? I have the following code in a when_validate_item trigger:

begin
if item1 is null (first in sequence)
and item2 is not null (seventh in sequence) then
message('item1 cannot be null when item2 is not null');
end if;
end;

I would like the cursor to move to item1. I can keep the cursor at item2 if I use form raise_trigger_failure, but I would rather the cursor move automatically to item1 if the condition is not met, so the user can change it.

many thanks
Re: move cursor (next item) to a text item lower in sequence [message #411231 is a reply to message #411226] Thu, 02 July 2009 11:07 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
That kind of checking is what when-validate-record is for.
but you can't do a go_item in when-validate triggers.
Re: move cursor (next item) to a text item lower in sequence [message #411591 is a reply to message #411231] Sun, 05 July 2009 19:28 Go to previous messageGo to next message
tuckersuz
Messages: 26
Registered: July 2009
Junior Member
Many thanks for your help. How can I move the cursor without a go_item? If the user must go back to an earlier sequence item to change it if conditions are not met in following items, how can I get the cursor to go back to the earlier sequence item?

Re: move cursor (next item) to a text item lower in sequence (merged 3) [message #411655 is a reply to message #411226] Mon, 06 July 2009 04:20 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Personally I wouldn't try.
You need go_item to move the cursor.
You can't use go_item in a when-validate trigger.
The best trigger to check they've enter all necessary values is when-validate.

I'd just display a message and leave it at that.
Previous Topic: FRM- 41213: Unable to connect to the report server error
Next Topic: I have a problem with forms
Goto Forum:
  


Current Time: Fri Sep 20 08:40:59 CDT 2024