Thursday, April 14, 2011

XML Bursting exceptions java.io.FileNotFoundException and Debugging

java.io.FileNotFoundException: (No such file or directory)  error fix.

Debugging error.
  1. Check if template used "xdo://AR.XXXXX_TEMPLATE.en.00/?getSource=true" in bursiting has territory assigned. If there is, then change 00 to en(United States)/your corresponding territory.
  2. Check if the name of template in the control file is same as template name
  3. Check the xml grouping defined in the control file select
  4. Check if you have Temporary directory set under Administration Tab --> General.

Tuesday, April 5, 2011

Alert in Oracle Forms for User Response


Step1:

Define alert in forms.



Step2:

Use below code to raise alert.
DECLARE
   al_id       alert;
   al_button   NUMBER;
BEGIN
   al_id := FIND_ALERT ('TEST_ALERT');
   al_button := SHOW_ALERT (al_id);

   IF al_button = alert_button1
   THEN                                          -- Alert_button1 value is OK
      --<<--Your Condition-->>
      NULL;
   ELSIF al_button = alert_button2
   THEN
                                         -- Alert_button1 value is Cancel
      --<<--Your Condition-->>
      RAISE form_trigger_failure;
   END IF;
END;

Wednesday, February 2, 2011

Iterate through form Block and update values

Use of first_Record, Next_Record, previous_record

Assign Old field Values in following triggers as per need

PRE-TEXT
WHEN-MOUSE-CLICK
KEY-UP
KEY-DOWN

:PARAMETER.P_OLD_VAL := :SYSTEM.CURRENT_VALUE;

Best way is to use a push button and use/modify following code in WHEN-BUTTON-PRESSED trigger

IF :SYSTEM.RECORD_STATUS = 'CHANGED' THEN
    IF :PARAMETER.P_OLD_VAL <> :PARAMETER.P_NEW_VAL THEN

    LOOP
        Next_Record;
        IF :PARAMETER.P_OLD_VAL <> :BLOCK.FIELD THEN
            previous_record; -- To stop at end of change
            --first_Record;
            EXIT;
        ELSE
            select :PARAMETER.P_NEW_VAL into :BLOCK.FIELD from dual
            where     :BLOCK.FIELD = :PARAMETER.P_OLD_VAL;
        END IF;   
    END LOOP;   
    END IF;   
ELSE
        MESSAGE('No Rows to Update');
END IF;

Conditional statements can be used to iterate though the block based on condition

go_block('your_block');
   first_record;
   loop
      if :block.field = 'Y' then
       --your statement
      end if;
     exit when :system.last_record = 'TRUE';
    next_record;
  end loop;