Sunday, December 18, 2016

 Auto-Refresh Data Block Timer's Trick  



In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,


     You may work in a critical work area where the change of data on time means a significant importance of the business data flow work progress.


    Data change controls the logical work flow the user expects 

      The start or the end of customer business transaction like:
  • The bank customer's queue needs an instance data refresh with the flow of  the in-coming bank-customers to determine the next customer's transaction or its end. 
  • The patient's role management control for doctors and nurse station in a medical clinic depends on the data of patient's attendance time. 

    Data change motivates your customer to make his purchasing decision.

       The daily or instance data change controls the client's decision like: 
  • The instant Stock prices change for shareholders needs a dynamic update or an auto-refresh for data blocks.
  • The daily foreign currency trading in the exchange companies and banks.
       
        Consequently, it is a significant task we need for a specific needs to fulfill the  requirements of your system application user.  On the other hand, Oracle form has not a direct control to auto-refresh you data block. But it gives you a free use of a timer where you can use it in different purposes.  Thus, let's start some simple work around using Oracle Forms' Timer.  


Task Definition:   

       Data Block Auto-Refresh


Task Solution:

        Initially, we need to know that the  timer is not an object but it is actually an internal clock you pro-grammatically create and manipulate displaying data automatically. So let's create a timer as follow...


Create a Timer:
  1.    Declare a variable of timer data type.
  2.      Initialize a variable with one second number data type.
  3.      Use a CREATE_TIMER built-in with the timer's name, interval and it's status  repeats every one second on timer's expiration.
  4.      Assign the timer's creation built-in to a variable of timer data type. 
  5.   In  WHEN-NEW-FORM-INSTANCE trigger Form-Level paste the following:    
DECLARE
   timer_id   Timer;
   one_sec    NUMBER (5) := 60000  ;   -- 1 minute in milliseconds
BEGIN
   timer_id := CREATE_TIMER ('MYTIMER', one_sec, REPEAT);
END;
                                    
    
       Delete a Timer:

       
       In timer's creation and expiration one second  created, executed in regards to current system date. It repeats itself endlessly. 
Paste the following code in When-Timer-Expired Trigger Form-Level :

BEGIN
EXECUTE_QUERY(NO_VALIDATE);
END; 
       
         
       In the previous example, i assumed you have one data block with multi-records.

       Now, you can compile, generate and  run the form, if it works then save your form as a ready made example you can refer to in a need.

       Let's assume, you have two  data blocks, you have to specify a logical master-detail relationship according to your table database master and detail relationship.
 Then, paste the following code in When-Timer-Expired Trigger Form-Level :


BEGIN
Go_block('block_name');
EXECUTE_QUERY(NO_VALIDATE);
END; 
   
      This is a simple data block refresh example without any restriction or conditions. 

If you want to Filter the data display into your block, then You have to follow one of the two ways:
  • Block Property: The master data block property > where clause.
  • Pro-grammatically: using the default_where clause.

     If you want to Order the data display into your block, then You have to follow one of the two ways:
  • Block Property: The master data block property > Order By clause.
  • Pro-grammatically: using the Order by using SET_BLOCK_PROPERTY built-in.

  

 Learn more about:


        ·       In-Direct Global Variable Access
   ·     Menu Item Enable/Disable



Hope this helps...


My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.



Tuesday, December 6, 2016

Timer Trick For Restricted Built-ins

Timer Trick For Restricted Built-ins



In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,


     Oracle forms has its own restricted built-in procedure for navigation, validation and database transactions processes.


                                   "There Is No Two Drivers For One Car"

      In regards to Oracle Forms navigational triggers, this example is true. It does not allow the application user to externally navigate to a block in a navigational trigger.


    The reason for this restriction we can simply imagine.  

       Let's assume the Oracle Form is the car.
       Let's assume the default internal Oracle Form's navigation during processing;   is the car driver number 1
       Let's assume the user navigation (with the mouse or the keyboard);
  is the car driver number 2
    
                The Question is ... does the car allow two car drivers at the same time? 
                                                  The Answer is No.
                                The same logic applies to Oracle Forms.
       
          Oracle forms allow the user to navigate into its blocks and items
If And Only If 
 the user's navigation does not conflict with its default internal navigation processing.
  
                          
    What does this mean in Oracle Forms ...?   

          It means that these navigational triggers fire in response to navigational events.
For instance, when the operator clicks on a text item in another block, navigational events occur as Oracle Forms moves the cursor focus from the current item to the target item.
 In concurrence, these navigational triggers also fire in response to Oracle Forms internal navigation during its default processing. 


    Normally, newbies get stuck in using such a restricted procedure in a navigational trigger. You can avoid this conflict by choosing another suitable trigger or by using Oracle Forms Timer's Trick. Now, let's start to learn how to get over this problem by using the Oracle Form's timer's trick. 


What is a timer ?

     A timer is an "internal time clock" that you pro-grammatically create to perform an action each time the timer expires.


What is the timer's usage ?

        A Timer Usages:

  1.     An  automatic forms data refresh.
  2.     An  automatic forms commit.
  3.     Animate forms interface e.g.
Ø  Displaying an image sequence for forms  presentation.
Ø  Creating a digital clock.
Ø  Displaying a marquee text, etc.


Problem Definition:   

       For such business requirements, at the moment the forms is pre-loading, the user needs the cursor focus to go to a specific block. Now, the forms rejects this navigation with the following error
   " FRM-40737: "Illegal restricted procedure GO_BLOCK in PRE-FORM trigger



Task Solution:

      The timer's trick is the main solution you can ever use with any illegal restricted procedure. Timers has the following  steps you should follow:


Create a Timer:
  1.    Declare a variable of timer data type.
  2.      Initialize a variable with one second number data type.
  3.      Use a CREATE_TIMER built-in with the timer's name, interval and it's status        whether it repeats on expiration or non-repeated; execute once only in  PRE-FORM trigger Form-Level.
  4.      Assign the timer's creation to that variable of timer data type with the following code :     
DECLARE
   timer_id   Timer;
   one_sec    NUMBER (5) := 1000;   -- in milliseconds
BEGIN
   timer_id := CREATE_TIMER ('MYTIMER', one_sec, REPEAT);
END;
                                    

       Delete a Timer:

       
       A Timer must has an end you specify to execute the restricted built-in sub-program within a specific trigger you create called When-Timer-Expired trigger Form-Level.

      In other words, between the timer's creation and its expiration a pre-determined tiny interval you specify on timer's creation, within this interval you can execute the restricted built-in sub-program with the following code in When-Timer-Expired Trigger Form-Level :



DECLARE
   tm_name    VARCHAR2 (40);
   timer_id   TIMER;
BEGIN
    -- Look for the timer existence.
   timer_id := FIND_TIMER ('MY_TIMER');
   -- If timer is created
   IF NOT ID_NULL (timer_id)   THEN
      -- Get the timer's name
      IF GET_APPLICATION_PROPERTY (TIMER_NAME) = 'MY_TIMER'  THEN           
         -- Use any illegal built-in to execute it in one second.
         GO_BLOCK ('DEPARTMENTS');
        --After 1 second no need for the timer you have to cancel it.
         DELETE_TIMER ('MY_TIMER');
      END IF;
   END IF;
END;

 

            Now, you can navigate to a block using a timer's trick in a PRE-FORM trigger and over comes  forms default behavior 
           The same logic used for any illegal restricted procedure. It all depends upon your business application logic for which you are using the timer
                 

 Learn more about:


        ·       In-Direct Global Variable Access
   ·     Menu Item Enable/Disable



Hope this helps...


My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.



Saturday, December 3, 2016

Oracle Form 10g Test Form

Oracle Form 10g Test Form 

(Not Running)



In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,



      In regards to Oracle Forms 10G Installation, you may face some errors.
You have to consider dealing with it but not reinstall it over the old copy.

  Problem Definition:   


       you may had a successful Oracle Forms 10G Installation afterwards you were unable to run the form. The following error message stuck the form running.




Task Solution 

1.     Use  Java 6 or Java 7

it is Certified with Forms and Reports 10g.

2.     Modify url: http://pc_name:Port/forms/frmservlet?config=test
e..g.  http://Amatu_Allah:8889/forms/frmservlet?config=test
3.     Create a working directory on default.env file FORMS_PATH=c:\DevSuiteHome_1\forms;


Hope this helps...



 Learn more about:




My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.