Illegal GO_ITEM in form

hi
i'm using oracle form 6i
i used go_items in many : when_validate_items  but it always sent me an error
frm-40737
desc v_emp
Name                           Null     Type                                                                                                                                                                                          
------------------------------ -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
EMP_ID                         NOT NULL NUMBER(15)                                                                                                                                                                                    
MAIN_ID                                 NUMBER(5)                                                                                                                                                                                     
V_STAT_TYPE                             NUMBER(1)                                                                                                                                                                                     
EMP_NO                                  NUMBER(6)                                                                                                                                                                                     
REMARK                                  VARCHAR2(255)                                                                                                                                                                                 
POSTING_DATE                            DATE                                                                                                                                                                                          
POSTED_BY                               VARCHAR2(50)                                                                                                                                                                                  
LOCATION                                NUMBER(5)                                                                                                                                                                                     
SUB_EMP_ID                              NUMBER(10)                                                                                                                                                                                    

9 rows selected

Open in new window


in the form , block v_emp
it is ascended like this
V_STAT_TYPE        then  emp_no then location
here is sample of one code
if :v_stat_type = 2  then
go_item(:v_emp.location);
end if;

Open in new window

NiceMan331Asked:
Who is Participating?
 
Helena MarkováConnect With a Mentor programmer-analystCommented:
Maybe you can use a timer.

When-Validate-Item trigger:
DECLARE
timer_id Timer;
BEGIN
if :v_stat_type = 2  then
timer_id :=create_timer('MY_TIMER_1',5,NO_REPEAT);
end if;
END;

In When-Timer-Expired trigger there will be GO_ITEM:
DECLARE
    X_S_TIMER_NAME VARCHAR2(30);
BEGIN
    X_S_TIMER_NAME := GET_APPLICATION_PROPERTY(TIMER_NAME);
   
    CASE X_S_TIMER_NAME
      WHEN X_S_TIMER_NAME='MY_TIMER_1' THEN
          GO_ITEM('V_EMP.LOCATION');
    ELSE
-- here you can add another timers
      NULL;
    END CASE;    
END;
0
 
flow01Commented:
Your giving as an argument of the go_item the value of the item v_emp.location (for example : 'New York' instead of the name of the item.
Try changing it to go_item('v_emp.location');
0
 
NiceMan331Author Commented:
i did
but same error
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Helena Markováprogrammer-analystCommented:
I think that problem is caused by using restricted built-in GO_ITEM in When-Validate-Item trigger where Legal Commands are SELECT statements and unrestricted Built-ins.
0
 
NiceMan331Author Commented:
so , what do you think the solution could be ?
0
 
Helena Markováprogrammer-analystCommented:
Instead of GO_ITEM I would display message to a user. You can also clear the value of item where validation fails.
0
 
NiceMan331Author Commented:
the idea is , when value of item is 2 for example , so need to go next item
directly skip and go to a specific item in the block
0
 
NiceMan331Author Commented:
now is ok
thanx
plz tell me , how timer solve it ?
what is the mechanizm of timer
it is a solution of what ?
0
 
Helena Markováprogrammer-analystCommented:
Timer is something like an internal clock. Here is the description from the Forms on-line help:

About Timers
 
A timer is an "internal time clock" that you programmatically create to perform an action each time the timer expires.

Timer duration can be between 1 and 2,147,483,647 millisecond (1 second=1000 milliseconds). The maximum duration of a timer is approximately 24.85 days.

When you work with timers you perform these steps:
Create the desired number of repeating or non-repeating timers using the CREATE_TIMER Built-in subprogram.
 Create a When-Timer-Expired trigger that performs the desired action whenever your timer expires.

Related topics

About timer usage rules
Creating a timer
Responding to multiple timers
CREATE_TIMER Built-in
When-Timer-Expired Trigger

You can find more about it in the Forms on-line help.
0
 
NiceMan331Author Commented:
ok i agree with you
but sorry to repeat another question
did go_item fail due to time reason , so the timer solve it ?
sorry again , i just want to understand why it fail there , then it success with timer
with full thanx
0
 
Helena Markováprogrammer-analystCommented:
There was no time reason there.
GO_ITEM is restricted built-in. If it is used in When-Validate-Item trigger, it fails, because in this trigger only unrestricted built-ins can be used.
When GO_ITEM was replaced with CREATE_TIMER,
the timer was created,
When-Validate-Item trigger was processed to the end
and when timer expired then When-Timer-Expired fired. In this trigger restricted built-ins can be used.
0
 
NiceMan331Author Commented:
ok , now i got it
thanx
0
 
Helena Markováprogrammer-analystCommented:
Have a nice day :).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.