Home » Developer & Programmer » Forms » Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422&
Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #192365] Tue, 12 September 2006 01:23 Go to next message
voralux
Messages: 72
Registered: January 2006
Member

Have 2 Table Name
Field	INVOICE_ID
Field	INVOICE_NUM
Field	INVOICE_DESCRIPTION
Field	INVOICE_AMOUNT

Table	LINE
Field	INVOICE_ID
Field	LINE_NUM
Field	LINE_DESCRIPTION
Field	LINE_AMOUNT

Data
Table : INVOICE
INVOICE_ID,INVOICE_NUM,INVOICE_DESCRIPTION,INVOICE_AMOUNT
1001, NUM001, Description 001,	500
1002, NUM002, Description 002,	1000
1003, NUM003, Description 003,	1500
Table : LINE
INVOICE_ID,LINE_NUM,LINE_DESCRIPTION,LINE_AMOUNT
1001,	1,	Description 001 Line 1,	200
1001,	2,	Description 001 Line 2,	300
1002,	1,	Description 002 Line 1,	1000
1003,	1,	Description 003 Line 1,	400
1003,	2,	Description 003 Line 2,	500
1003,	3,	Description 003 Line 3,	600

I create a form have a 2 blocks
I add a procedure for show invoice line after selete invoice_num
but the program show only INVOICE_ID = 1002 (Have a 1 Line)
if a select inv_num = NUM001 this program show error = "FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422"
SELECT Line.Line_Amount,
       Line.Line_Description
INTO   :LINE.Line_Amount,
       :LINE.Line_Description
FROM   Invoice,
       Line
WHERE  Invoice.Invoice_Id = Line.Invoice_Id
       AND Invoice.Invoice_num = :INVOICE.Invoice_num
       AND Invoice.Invoice_Id = :INVOICE.Invoice_Id;


Upd-Mod: Please format your code and present it in a readable form.

[Updated on: Tue, 12 September 2006 21:17] by Moderator

Report message to a moderator

Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #192566 is a reply to message #192365] Tue, 12 September 2006 21:18 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Why are you doing this by hand?

Create two blocks, build 'relations' between them and let Forms do the work for you!

David
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #192579 is a reply to message #192365] Tue, 12 September 2006 22:02 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

I know the function "Master-Detail" use the wizard and can use query& execute, but i want to create icon for execute.
Please help me for sql = "execute"
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #192590 is a reply to message #192579] Tue, 12 September 2006 23:09 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Create Relationship between Master & Detail Block and
Set Property Deffered to Yes
Set AutoQuery to No,

Then Write When-Button-Pressed Trigger on ur Button as
Go_block('Detail');

Hope it will work as u want.

Sandy

[Updated on: Tue, 12 September 2006 23:11]

Report message to a moderator

Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #192718 is a reply to message #192365] Wed, 13 September 2006 06:06 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

if i add from your suggest
Create Relationship between Master & Detail Block and
Set Property Deffered to Yes
Set AutoQuery to No,

Then Write When-Button-Pressed Trigger on ur Button as
Go_block('Detail');

Then Write When-Button-Pressed Trigger on ur Button as
Go_block('Detail');

not show data in block "detail"

for my work.
If i select the invoice number = NUM001 & select item "A" (block "item")
I want to the program (block "line") show 2 record
1001, 1, Description 001 Line 1, 200
1001, 2, Description 001 Line 2, 300
same result if i use the wizard
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #192858 is a reply to message #192718] Wed, 13 September 2006 23:37 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Opps sorry for my previous post, i had missed something there

Either do this
Create Relationship between Master & Detail Block and
Set Property Deffered to Yes
Set AutoQuery to YES,

Then Write When-Button-Pressed Trigger on ur Button as
Go_block('Detail');

or

Create Relationship between Master & Detail Block and
Set Property Deffered to Yes
Set AutoQuery to No,

Then Write When-Button-Pressed Trigger on ur Button as
set_block_property('detail','default_where','you condition');
Go_block('Detail');
execute_query;


sandy
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #194126 is a reply to message #192365] Wed, 20 September 2006 20:53 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

Thank you for your suggestion.

1. After i select invoice Num & click"OK"
this program show block "Do you want to save the changes you have made?
Yes or No or Cancel" and Press Ctrl+Tab to move between choices, Enter to select.
I click "No" this program show detail invoice line.
I want to this program no show block.

2. I want to save data after i change any field.
I not use the menu bar.

Thankyou verymuch.
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #194128 is a reply to message #192365] Wed, 20 September 2006 22:06 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

for save record : after i change data
i use "commit;"

for delete record :
I use "DELETE FROM TABLE_NAME_INVOICE
WHERE invoice_id = :BLOCK_NAME_INVOICE.invoice_id;
COMMIT;
DELETE FROM TABLE_NAME_LINE
WHERE invoice_id = :BLOCK_NAME_LINE.invoice_id;
COMMIT;

but i have a question
this program show block "Do you want to save the changes you have made?
Yes or No or Cancel" and Press Ctrl+Tab to move between choices, Enter to select.
I click "No" this program show detail invoice line.
I want to this program no show block.
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #194136 is a reply to message #194128] Wed, 20 September 2006 23:14 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

use clear_block(no_validate) for detail block before moving into it.

Sandy
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #194373 is a reply to message #192365] Thu, 21 September 2006 15:02 Go to previous messageGo to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
I got a similar error message previously and all I did was expand the length for one of my fields. Just a suggestion.
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195099 is a reply to message #192365] Wed, 27 September 2006 01:49 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

Thank you - Sandy
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195103 is a reply to message #192365] Wed, 27 September 2006 01:54 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

I have a more question

I have a Table Name = TABLE_INVOICE
Fields :
Invoice_Number,
Invoice_Amount,
Invoice_Description,
Line_Number,
Line_Amount,
Line_Date

Data
INV_001, 1000.00, DESCRPTION NO1, 1, 1000, 01-JAN-06
INV_002, 2000.00, DESCRPTION NO2, 1, 1200, 05-JAN-06
INV_002, 2000.00, DESCRPTION NO2, 2, 800, 05-JAN-06
INV_003, 3000.00, DESCRPTION NO3, 1, 500, 11-JAN-06
INV_003, 3000.00, DESCRPTION NO3, 2, 1400, 11-JAN-06
INV_003, 3000.00, DESCRPTION NO3, 3, 1100, 11-JAN-06

If I select invoice_number, I want to the program show data invoice line & can edit field line_date
Ex. If I select Invoice_number = INV_002
The program show 2 lines,
INV_002, 2000.00, DESCRPTION NO2, 2, 800, 05-JAN-06
INV_003, 3000.00, DESCRPTION NO3, 1, 500, 11-JAN-06

I have 2 Data Blocks
1. Control : have fields – Invoice_number, OK
OK : WHEN-BUTTON-PRESSED
set_block_property(TABLE_INVOICE,DEFAULT_WHERE,'INVOICE_NUMBER ='||:control.INVOICE_NUMBER);
Go_block('TABLE_INVOICE');
clear_block(no_validate);
execute_query;

2. TABLE_INVOICE : have field – Line_Number, Line_Amount, Line_Date

I want to show data If I select Invoice_number & Click “OK”
But after I click “OK” the program show “FRM-40505: ORACLE error unable to perform query

Please help me,
Thank you
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195114 is a reply to message #195103] Wed, 27 September 2006 02:16 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Press shift+F1 when getting error and post the error query and message.

Sandy
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195151 is a reply to message #192365] Wed, 27 September 2006 03:58 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

Error Show
"SELECT ROWID,ITEM_DESCRIPTION,QUANTITY,UNIT_PRICE,REQ_NUMBER_SEGMENT1,HEADER_DESCRIPTION,NEED_BY_DATE,GL_DATE FROM PO_REQUISITIONS_INTERFACE_ALL WHERE REQ_NUMBER_SEGMENT1 =PR06/07/2721 "

it correct =SELECT ROWID,ITEM_DESCRIPTION,QUANTITY,UNIT_PRICE,REQ_NUMBER_SEGMENT1,HEADER_DESCRIPTION,NEED_BY_DATE,GL_DATE FROM PO_REQUISITIONS_INTERFACE_ALL WHERE REQ_NUMBER_SEGMENT1 = 'PR06/07/2721'

please suggest edit?
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195153 is a reply to message #195151] Wed, 27 September 2006 04:05 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

send code of button ok too. like if you are using set_block_property..


Sandy
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195161 is a reply to message #192365] Wed, 27 September 2006 04:44 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

Name : WHEN-BUTTON-PRESSED

set_block_property('PO_REQUISITIONS_INTERFACE_ALL',DEFAULT_WHERE,'REQ_NUMBER_SEGMENT1 ='||:control.REQ_NUMBER_SEGMENT1);
Go_block('PO_REQUISITIONS_INTERFACE_ALL');
clear_block(no_validate);
execute_query;
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195163 is a reply to message #195161] Wed, 27 September 2006 04:48 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Replace Your code with following code...


set_block_property('PO_REQUISITIONS_INTERFACE_ALL',DEFAULT_WHERE,'REQ_NUMBER_SEGMENT1 ='''||::control.REQ_NUMBER_SEGMENT1||'''');
Go_block('PO_REQUISITIONS_INTERFACE_ALL');
clear_block(no_validate);
execute_query; 



Sandy
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195167 is a reply to message #192365] Wed, 27 September 2006 04:56 Go to previous messageGo to next message
voralux
Messages: 72
Registered: January 2006
Member

Dear Sandy,
thank you very much.
Re: Please help me :"FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA01422& [message #195192 is a reply to message #192365] Wed, 27 September 2006 06:35 Go to previous message
RJ.Zijlstra
Messages: 104
Registered: December 2005
Location: Netherlands - IJmuiden
Senior Member
Well Voralux,

You can now be assured you have created a form which in a few years nobody will understand the logic of... (and will 'praise' your name)

Please, take my advice and use the standard Forms functionality and if not, write very extensive documentation for every trigger/program unit you create. A few hundred pages per form will be suffuicient, I think.

I work here with some appl. where the forms 'logic' is often made of these nice constructions; consequences:

1) You almost do not dare to change a thing, because the whole bloody thing will collapse in front of your eyes with the most misleading error messages.

2) The time you need to understand the 'logic' of these monstuosities is much better spend in a more productive way.

3) Often it's much easiier to throw the whole existing form in the wastebucket and rebuild it from scratch, but then in a 'normal' way.


Don't think I'm harsh on you specially, I give some advice I learned the hard way...

Regards,

Rob Zijlstra
Previous Topic: set_item_property
Next Topic: CALL_FORM
Goto Forum:
  


Current Time: Mon Dec 05 08:33:07 CST 2016

Total time taken to generate the page: 0.06042 seconds