Home » Developer & Programmer » Forms » FOR SEARCH MANY BLOCK (Oracle Forms 6i)
FOR SEARCH MANY BLOCK [message #558879] Wed, 27 June 2012 01:44 Go to next message
Al_SAMHOURI
Messages: 4
Registered: June 2012
Location: JORDAN
Junior Member

I like to create 3 block
1- Block 1 CHECKS_HDR search from LOV FROM NO. TO NO. after that click Icone SEARCH
2- Block 2 Tabular CHECKS_DTL display Item Fro 10 Row
3- Block 3 Tabular XX_AUDIT_CHECK ITEM 10 Row alongside Block 2 CHECKS_DTL
CREATE TABLE XX_AUDIT_CHECK
(
CHECK_ID VARCHAR2(15 BYTE),
CHECK_NO VARCHAR2(15 BYTE),
CHECK_CONDITION VARCHAR2(1 BYTE),
DATE_CHECK DATE,
USER_CHECK VARCHAR2(50 BYTE),
REMARK VARCHAR2(200 BYTE),
UPDATE_NAME VARCHAR2(100 BYTE)
)

PROBLEM :-

IF I CAN To CHECK_CONDITION (Y/N) IF YES you Can Create Username and sysdate For Every Row
And Write this code

when-checkbox-changed

BEGIN
IF :XX_AUDIT_CHECK.CHECK_CONDITION='Y'THEN
:XX_AUDIT_CHECK.CHECK_ID :=:CHECKS_DTL.VOUCHER_NUM;
:XX_AUDIT_CHECK.CHECK_NO:=:CHECKS_DTL.CHECK_NO;
:XX_AUDIT_CHECK.CHECK_CONDITION:='Y';
:XX_AUDIT_CHECK.USER_CHECK:=FND_GLOBAL.USER_NAME;
:XX_AUDIT_CHECK.DATE_CHECK:=SYSDATE;
:XX_AUDIT_CHECK.REMARK:=:XX_AUDIT_CHECK.REMARK;
ELSIF :XX_AUDIT_CHECK.CHECK_CONDITION='N' THEN
:XX_AUDIT_CHECK.CHECK_ID :=:CHECKS_DTL.VOUCHER_NUM;
:XX_AUDIT_CHECK.CHECK_NO:=:CHECKS_DTL.CHECK_NO;
:XX_AUDIT_CHECK.CHECK_CONDITION:='N';
:XX_AUDIT_CHECK.USER_CHECK:=FND_GLOBAL.USER_NAME;
:XX_AUDIT_CHECK.DATE_CHECK:=SYSDATE;
:XX_AUDIT_CHECK.REMARK:=:XX_AUDIT_CHECK.REMARK;
END IF;
END;
this is code is correct

but when I can retrieve data (New Search ) the new data From No. to No.
we can Incorrect Data in block 3 (XX_AUDIT_CHECK ) , Rows is not arranged alongside In Block 2 ( CHECKS_DTL ) ,despite Write this Code In the Icons SEARCH In Block 1

BEGIN
go_block('XX_AUDIT_CHECK' );

FIRST_RECORD;
LOOP
select NVL(AP.XX_AUDIT_CHECK.CHECK_ID,''),NVL(AP.XX_AUDIT_CHECK.CHECK_NO,''),
NVL(AP.XX_AUDIT_CHECK.CHECK_CONDITION,'N'),NVL(AP.XX_AUDIT_CHECK.date_check,sysdate),NVL(AP.XX_AUDIT_CHECK.USER_CHECK,FND_GLOBAL.USER _NAME),NVL(AP.XX_AUDIT_CHECK.remark,''),NVL(Ap.XX_AUDIT_CHECK.UPDATE_NAME,FND_GLOBAL.USER_NAME)
INTO :XX_AUDIT_CHECK.CHECK_ID,
:XX_AUDIT_CHECK.CHECK_NO,
:XX_AUDIT_CHECK.CHECK_CONDITION,
:XX_AUDIT_CHECK.date_check,
:XX_AUDIT_CHECK.USER_CHECK,
:XX_AUDIT_CHECK.remark,
:XX_AUDIT_CHECK.UPDATE_NAME
from AP.XX_AUDIT_CHECK
WHERE XX_AUDIT_CHECK.CHECK_NO BETWEEN :CHECKS_HDR.CHECK_NO_FROM AND :CHECKS_HDR.CHECK_NO_TO
AND ( :CHECKS_DTL.CHECK_NO=:XX_AUDIT_CHECK.CHECK_NO)
ORDER BY TO_NUMBER(:XX_AUDIT_CHECK.CHECK_NO);
EXIT WHEN :System.Last_Record = 'TRUE';
NEXT_RECORD;
END LOOP;
FIRST_RECORD;
EXCEPTION

when NO_DATA_FOUND THEN
:XX_AUDIT_CHECK.CHECK_ID :=NVL(:XX_AUDIT_CHECK.CHECK_ID,'');
:XX_AUDIT_CHECK.CHECK_NO :=NVL(:XX_AUDIT_CHECK.CHECK_NO,'');
:XX_AUDIT_CHECK.CHECK_CONDITION:= NVL(:XX_AUDIT_CHECK.CHECK_CONDITION,'N');
:XX_AUDIT_CHECK.date_check:=NVL(:XX_AUDIT_CHECK.date_check,sysdate);
:XX_AUDIT_CHECK.USER_CHECK:=NVL(:XX_AUDIT_CHECK.USER_CHECK,FND_GLOBAL.USER_NAME);
:XX_AUDIT_CHECK.remark:=NVL(:XX_AUDIT_CHECK.remark,'');
:XX_AUDIT_CHECK.UPDATE_NAME:=NVL(:XX_AUDIT_CHECK.UPDATE_NAME,FND_GLOBAL.USER_NAME);
WHEN TOO_MANY_ROWS THEN
:XX_AUDIT_CHECK.CHECK_ID :=NVL(:XX_AUDIT_CHECK.CHECK_ID,'');
:XX_AUDIT_CHECK.CHECK_NO :=NVL(:XX_AUDIT_CHECK.CHECK_NO,'');
:XX_AUDIT_CHECK.CHECK_CONDITION:= NVL(:XX_AUDIT_CHECK.CHECK_CONDITION,'N');
:XX_AUDIT_CHECK.date_check:=NVL(:XX_AUDIT_CHECK.date_check,sysdate);
:XX_AUDIT_CHECK.USER_CHECK:=NVL(:XX_AUDIT_CHECK.USER_CHECK,FND_GLOBAL.USER_NAME);
:XX_AUDIT_CHECK.remark:=NVL(:XX_AUDIT_CHECK.remark,'');
:XX_AUDIT_CHECK.UPDATE_NAME:=NVL(:XX_AUDIT_CHECK.UPDATE_NAME,FND_GLOBAL.USER_NAME);
WHEN OTHERS THEN
:XX_AUDIT_CHECK.CHECK_ID :=NVL(:XX_AUDIT_CHECK.CHECK_ID,'');
:XX_AUDIT_CHECK.CHECK_NO :=NVL(:XX_AUDIT_CHECK.CHECK_NO,'');
:XX_AUDIT_CHECK.CHECK_CONDITION:= NVL(:XX_AUDIT_CHECK.CHECK_CONDITION,'N');
:XX_AUDIT_CHECK.date_check:=NVL(:XX_AUDIT_CHECK.date_check,sysdate);
:XX_AUDIT_CHECK.USER_CHECK:=NVL(:XX_AUDIT_CHECK.USER_CHECK,FND_GLOBAL.USER_NAME);
:XX_AUDIT_CHECK.remark:=NVL(:XX_AUDIT_CHECK.remark,'');
:XX_AUDIT_CHECK.UPDATE_NAME:=NVL(:XX_AUDIT_CHECK.UPDATE_NAME,FND_GLOBAL.USER_NAME);
END;


You Can HELP Me for this Code :
Re: FOR SEARCH MANY BLOCK [message #558886 is a reply to message #558879] Wed, 27 June 2012 02:23 Go to previous messageGo to next message
Littlefoot
Messages: 19320
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Generally speaking, you should avoid programming anything that Forms does by itself.

As far as I understood the question, it is a master-detail-detail layout. Perhaps you should create the form that way, using Data Block Wizard. Follow its instructions carefully and properly join all columns (if tables are related to each other by referential integrity constraints, Forms might do that itself).

Once you are done, run the form. Enter query mode, enter search criteria, execute query. It *should* retrieve some records.

Then you can try to make it fancy. I saw you use checkboxes and stuff - add each functionality one by one; test frequently.

I'd suggest you to set these WHERE conditions with SET_BLOCK_PROPERTY built-in (its ONETIME_WHERE property) or, alternatively, in PRE-QUERY block level trigger(s).

Finally, a note: before posting your next message, please, have a look here - it will take just a few seconds, but will teach you how to properly post your code in order to keep the formatting and make it easier to read.
Re: FOR SEARCH MANY BLOCK [message #558924 is a reply to message #558886] Wed, 27 June 2012 07:22 Go to previous messageGo to next message
Al_SAMHOURI
Messages: 4
Registered: June 2012
Location: JORDAN
Junior Member

Mr Littlefoot I am Send the file by email
you can check it and replay for the results


Thanks Very Much ...........
Re: FOR SEARCH MANY BLOCK [message #558927 is a reply to message #558924] Wed, 27 June 2012 07:58 Go to previous message
Al_SAMHOURI
Messages: 4
Registered: June 2012
Location: JORDAN
Junior Member

i CAN WRITE IT THE CODE

BUT IT HE IS ERROOR IN THE APPLICATION


yOU CAN HELP ME

THANKS




DECLARE
CURSOR XX IS
SELECT XX_AUD.CHECK_ID,XX_AUD.CHECK_NO,
XX_AUD.CHECK_CONDITION,XX_AUD.DATE_CHECK,
XX_AUD.USER_CHECK,XX_AUD.REMARK,
XX_AUD.UPDATE_NAME
FROM AP.XX_AUDIT_CHECK XX_AUD
where XX_AUD.CHECK_NO BETWEEN :CHECKS_HDR.CHECK_NO_FROM AND :CHECKS_HDR.CHECK_NO_TO;
BEGIN
FOR X_REC IN XX
LOOP
GO_BLOCK('XX_AUDIT_CHECK ');
IF :XX_AUDIT_CHECK.CHECK_NO ='TRUE'
THEN
:XX_AUDIT_CHECK.CHECK_ID :=X_REC.CHECK_ID;
:XX_AUDIT_CHECK.CHECK_NO :=X_REC.CHECK_NO;
:XX_AUDIT_CHECK.CHECK_CONDITION :=X_REC.CHECK_CONDITION;
:XX_AUDIT_CHECK.DATE_CHECK :=X_REC.DATE_CHECK;
:XX_AUDIT_CHECK.USER_CHECK:=X_REC.USER_CHECK;
:XX_AUDIT_CHECK.REMARK:=X_REC.REMARK;
:XX_AUDIT_CHECK.UPDATE_NAME:=X_REC.UPDATE_NAME;
ELSE
:XX_AUDIT_CHECK.CHECK_ID :=NULL;
:XX_AUDIT_CHECK.CHECK_NO :=NULL;
:XX_AUDIT_CHECK.CHECK_CONDITION :=NULL;
:XX_AUDIT_CHECK.DATE_CHECK :=NULL;
:XX_AUDIT_CHECK.USER_CHECK:=NULL;
:XX_AUDIT_CHECK.REMARK:=NULL;
:XX_AUDIT_CHECK.UPDATE_NAME:=NULL;

END IF;
END LOOP;
EXCEPTION
when NO_DATA_FOUND THEN NULL;
END;
Previous Topic: Icons not appearing in 10g forms after webutil configuration on OAS
Next Topic: delay when loading forms with webutil
Goto Forum:
  


Current Time: Mon Jul 28 12:32:46 CDT 2014

Total time taken to generate the page: 0.05804 seconds