We help IT Professionals succeed at work.

Can't use go_item

SFMelange
SFMelange asked
on
4,553 Views
Last Modified: 2012-06-27
In a when-validate-item (w-v-i) trigger :item = 'Y' I want the cursor to move to a previous item on the  canvas. I cannot use a go_item in a w-v-i trigger. I tried a key-next-item with a go_item and it didn't GO.

K-N-I code
if :suspected_of_drug = 'Y'
   and :criminal_activity_code is null
   then
   go_item('incident_offenses.Criminal_Activity_Code');
end if;
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
key-next-item trigger use this do_key('enter');

key-enter trigger -
if :suspected_of_drug = 'Y'
   and :criminal_activity_code is null
   then
   go_item('incident_offenses.Criminal_Activity_Code');
end if;

Try this

Author

Commented:
anumoses, I tried your suggestion but received an error - am I misunderstanding something?

1. created a key-next-itme with do_key('key-enter');
2. created key-enter trigger
3. got error on:
key-enter trigger -
    if :suspected_of_drug = 'Y'
    and :criminal_activity_code is null
    then go_item('incident_offenses.Criminal_activity_code');
   end if;
Error 103 at line 1 column 4
encountered the symbol "." when excepting one of the following:  :=.(@%;
This error is flagging the first hyphen on the first line key-enter trigger
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
You can also use previous_item; in the key-enter trigger
and keep the code for key-next-item as it is with do_key('enter');

Commented:
 if (:suspected_of_drug = 'Y' and :criminal_activity_code is null ) then
    go_item('incident_offenses.Criminal_activity_code');
   end if;
OR
  if (:suspected_of_drug = 'Y' and :criminal_activity_code is null ) then
    previous_item;
   end if;

This is for key-enter trigger

Author

Commented:
anumoses,
Yes, these triggers are at item level.
Why am I getting an error on "the first line" which is auto populated "key-enter trigger -"
As for the "key-next-item "do_key('enter'); "  IS IT ('enter') or is it ('key-enter') ?
Thanks for the help.

Commented:
what is your forms version?

Author

Commented:
anumoses
10g

Commented:
create a test .fmb

three fields.

In the second field add the code
key-enter trigger  and key-next-item trigger
key-enter trigger - code is previous_item;
key-next-item - code is do_key('enter');
Try and run this.  Here I cannot upload fmb.

Commented:
I ran in forms 10g. so it works for me

Commented:
its do_key('enter');  - correct


not do_key('key-enter'); in - correct

Commented:
Try this also
Do_Key('PREVIOUS_ITEM');  in w-v-i
IT-specialist
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I used the advice of the thee experts and came up with my own solution.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.