But Kevin

5
But Kevin's second solution would do it: Set a packaged variable and put the code in a form-level WHEN-NEW-ITEM-INSTANCE Create a package speci cation in the form -- I always name such a package P0. In the package, create a variable: Next_Itm varchar2(60); In your post-text-item trigger, set the package value: P0.Next_Itm := 'BLOCK_B2.ITE_6'; In the form-level when-new-item-instance trigger: I! P0.Next_Itm "# $%t $& the$ %_Item(P0.Next_Itm); P0.Next_Itm := $& ; E$ "!; Oracle WHEN-VALIDATE-ITEM trigger go_item, go_block navigation uing WHEN-TIME!-E"#I!ED trigger Update You can streamline the entire experience with following simplified WHEN-TIMER-EXIRE! code "egin ifGET_APPLICATION_PROPERTY #T IMER $NAME % & 'MY$TIMER( then )*$"+*, #'Y*.R$"+*, $N/ME(%0 Execute$1uer2#N*$3/+I!/TE%0 end if0 and change 2our WHEN-3/+I!/TE-ITEM trigger coding as following

description

But Kevin

Transcript of But Kevin

But Kevin's second solution would do it:

But Kevin's second solution would do it:

Set a packaged variable and put the code in a form-level WHEN-NEW-ITEM-INSTANCE

Create a package specification in the form -- I always name such a package P0.In the package, create a variable: Next_Itm varchar2(60);In your post-text-item trigger, set the package value: P0.Next_Itm := 'BLOCK_B2.ITEM_6';In the form-level when-new-item-instance trigger: If P0.Next_Itm is not null then

Go_Item(P0.Next_Itm);

P0.Next_Itm := null;

End if;Oracle WHEN-VALIDATE-ITEM trigger go_item, go_block navigation using WHEN-TIMER-EXPIRED trigger

UpdateYou can streamline the entire experience with following simplified WHEN-TIMER-EXPIRED codeBeginifGET_APPLICATION_PROPERTY(T IMER_NAME) = MY_TIMER thenGO_BLOCK(YOUR_BLOCK_NAME); Execute_Query(NO_VALIDATE);end if;and change your WHEN-VALIDATE-ITEM trigger coding as followingDECLAREt_id TIMER;Begin/* Do all your validations here, raise form failure trigger etc until the entered data is satisfying the requirements*/t_id := CREATE_TIMER('MY_TIMER',1,NO_REPEAT);End;This will create & expire the timer as soon as the validations completed and WHEN-TIMER-EXPIRED trigger @ form level will check the expired timer name and process the instructions..

Note: Infrastructure (Windows 7 64bit professional, Oracle developer 6i 32bit (6.0.8.27.0), Database 11g Enterprise

Source/Cause for this thread:click hereIf you are Oracle developer, the most perplexing requirement would be populating a dataset within a second block once after an item validated using restricted trigger WHEN-VALIDATE-ITEM. By default WHEN-VALIDATE-ITEM doesnt allow calling restricted procedure calls like GO_ITEM, GO_BLOCK and many others.

However, there are certain workarounds. A developer may use WHEN-TIMER-EXPIRED trigger to navigate away from the items which was just validated using WHEN-VALIDATE-ITEM trigger.

Alter your WHEN-VALIDATE-ITEM as following:

DECLAREt_id TIMER;Begin/* Do all your validations here, raise form failure trigger etc until the entered data is satisfying the requirements*/t_id := CREATE_TIMER('QRY_BLOCK',1,REPEAT);End;Add the following to your WHEN-TIMER-EXPIRED trigger @ form level.

Declaret_id TIMER;Begint_id := find_timer('QRY_BLOCK');IF NOT ID_NULL(t_id) thenGO_BLOCK('YOUR_BLOCK_NAME');Execute_Query(NO_VALIDATE); -- ExampleDELETE_TIMER('QRY_BLOCK'); -- Deleting the timer as we don't require it any further until the item fires WHEN-VALIDATE-ITEM trigger once again.END IF;/* Check whether the timer is still alive

for testing purpose only*/

t_id := find_timer('QRY_BLOCK');IF ID_NULL(t_id) thenmessage('TIMER ALREADY DELETED');end if;

End;Hope this example is useful for budding Oracle developers.

For Windows7bugs,

Admin

Actual scripting byOTN Guru Craigis as following and he suggests the code runs perfectly under certified environments.

The best place would be the Item When-Validate-Item (WVI) trigger but you will need to create a timer in your WVI code in or der to execute the Restricted Built-in since the WVI trigger only allows SQL and Unrestricted built-ins. You will also need to create a Form level When-Timer-Expired (WTE) trigger.For example:

/* Add this code to your WVI trigger */DECLAREt_id TIMER;BEGIN/* Perform your validate here */t_id := Create_Timer('QRY_BLOCK',1,NO_REPEAT);END;/* Sample code for your WTE trigger */

DECLAREt_id TIMER;BEGINt_id := Find_Timer('QRY_BLOCK');IF NOT ID_NULL(t_id) THEN-- Timer FoundGO_BLOCK('YOUR_BLOCK_NAME');Execute_Query;END IF;END;