Home » Developer & Programmer » Forms » delete_record trigger in forms 10g
delete_record trigger in forms 10g [message #182666] Mon, 17 July 2006 09:02 Go to next message
joshram
Messages: 4
Registered: July 2006
Junior Member
Hi

I'm having a block where the delete allowed property set to yes.Now when i run the form and put a value in one of the fields and try to ENTER_QUERY i get message from my on-error trigger "You cannot delete this record".
Te trigger in key enter query contains code wherein

if :system.block_status <>'NEW'
and if :system.record_status = 'INSERT'
then
delete_record;
end if;

for the abovementioned case my :system.block_status is 'CHANGED' and system.record_status is INSERT.So the delete_record gets fired but since i did not put any value in other fields items in the form the delete_record fails n i get the above message with series of "field must be entered " errors.

This problem i'm facing in 10g only.
When i'm running the same code in forms 5.0 it works fine.

When i looked at the help files in both i found that in 5.0 when delete_record is fired the chk is made whether record exists in database and if no then "CLEAR_RECORD" is performed.However the same is missing in 10g help file.
Is this behaviour obsolete in 10g??

I still dont understand if my record is in INSERT mode and i try to ENTER_QUERY the form should just clear the form and return to ENTER_QUERY mode isnt it?

Pls suggest if i'm going in wrong direction.
Not to mention the same form is migrated from 5.0 to 10g using migration assistant.

Thanks in advance
Ram.
Re: delete_record trigger in forms 10g [message #182956 is a reply to message #182666] Tue, 18 July 2006 23:34 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I believe you have written the answer in your query. Just use 'clear_record'.

David
Re: delete_record trigger in forms 10g [message #182975 is a reply to message #182956] Wed, 19 July 2006 01:02 Go to previous messageGo to next message
joshram
Messages: 4
Registered: July 2006
Junior Member
Hi David

Well i had tried that already before n it works too.
But my concern is that what if there is already a record POSTED in database by the same form?? (not yet commited).
In this case my DELTE_RECORD should serve my purpose and CLEAR_RECORD however will mislead me.
A database record that has been cleared is not processed as a delete by the next Post and Commit Transactions process.
And that is how the DELTE_RECORD behaviour used to be..

Chk if record exists in DB->If no then fire CLEAR_RECORD (assuming block has delete allowed property set to Yes)

Why it is failing here in 10g then??

Isnt there a firm solution of this?
i mean do i have to go by the CLEAR_RECORD workaround only then?
Please help

Thanks again
Ram.
Re: delete_record trigger in forms 10g [message #182998 is a reply to message #182975] Wed, 19 July 2006 02:41 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
The Forms reference manual, with reference to 'system.record_status', says 'INSERT' = 'Indicates that the record's validation status is Changed and that the record does not exist in the database.'

I can only suggest that you run a test and find out whether the record_status changes after a 'post', and what effect a 'clear_record' has on an 'inserted' recorded that has been 'posted'.

David
Previous Topic: FRM-40102 (PLS HELP URGENT!!!!!!!!)
Next Topic: TAB problem
Goto Forum:
  


Current Time: Fri Sep 20 08:31:17 CDT 2024