Friday, February 24, 2012

Display/Set WHO columns for Record History in Oracle Forms

Call FND_STANDARD.SET_WHO procedure in data blocks pre-insert and pre-update triggers where record history is needed.

 It only works on database data blocks.

Set Inventory organization selection for custom form

Call procedure FND_ORG.CHOOSE_ORG in PRE-FORM to ensure the organization parameters are set.

You need to define 3 parameters in your FMB to make procedure work.
ORG_NAME
ORG_CODE
CHART_OF_ACCOUNTS_ID

Other useful FNDSQF Routine API's
http://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T462356.htm

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;

Friday, July 23, 2010

FTP in UNIX with Error Handling

Here is the script to handle FTP in UNIX. It also includes error including.

unix command $? will not capture error status, so error message has to be written to a logfile and then read.

error_log=/tmp/error_log.log
lc_server_name="your.ftp.server.name"
echo "1" $lc_server_name
ftp -i -n -d<<EOF >$error_log
open $lc_server_name
user userid password
bye
EOF
result=`grep -c 'Not connected.' error_log.log`
result1=`grep -c 'Login failed.' error_log.log`
echo $result
echo $result1
if [ ${result} -gt 0 -o ${result1} -gt 0 ]; then
echo "Connect to FTP failed"
else
echo "Connection Successful"
fi

Thursday, June 24, 2010

APP-FND-01926 - The custom event WHEN-LOGON-CHANGED raised unhandled exception.

"APP-FND-01926 - The custom event WHEN-LOGON-CHANGED raised unhandled exception. ORA-06508 PL/SQL could not find program unit being called"

Usually this error occurs when opening Form in application.

This happens mostly after Upgrade/Clone of applications.

Reason being invalid objects in Custom.pll, form throws an error when opened.

This solution applicable in most cases when apps is cloned.

Compilation of pll's from Unix will compile only standard pll's. Custom pll's used has to be compiled manually.

To know existing custom Pll's open custom.pll in forms developer and expand Attached Libraries. The libraries you see there are probably the pll's that has to be compiled from Unix.

Compile custom pll's using the following command to generate plx.

f60gen module=.pll userid=userid/pwd output_file=$AU_TOP/resource/.plx module_type=library batch=no compile_all=special

Eg:

f60gen module=ABC.pll userid=APPS/PWD output_file=$AU_TOP/resource/ABC.plx module_type=library batch=no compile_all=special


For Upgrade

Check CUSTOM package body in custom.pll, you might have missed some objects that are referred. If any DB objects are missing, compiling (SHIFT+CTRL+K) form might help.