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 Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/d99a5fc8d6dba27619e624caba1f0b4a?s=64&d=mm&r=g) |
Al_SAMHOURI
Messages: 4 Registered: June 2012 Location: JORDAN
|
Junior Member |
![samhouri2004%40yahoo.com](/forum/theme/orafaq/images/yahoo.png)
|
|
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 message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 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.
|
|
|
|
|
Goto Forum:
Current Time: Sun Sep 01 16:25:35 CDT 2024
|