Home » Developer & Programmer » Forms » Problem with Pre-Record trigger
Problem with Pre-Record trigger [message #263906] Fri, 31 August 2007 04:36 Go to next message
dmel
Messages: 2
Registered: August 2007
Location: Athens, Greece
Junior Member
Hi there,
I tried to create the following PRE-RECORD trigger on block B2 (B1 is Master block and B2 is Detail):
  if :system.record_status='NEW' then
    raise form_trigger_failure;
  end if;

The "Fire in Enter-Query Mode" property is No.
However when I go to next record on B1, the trigger on B2 is fired twice because of the 'Query_Master_Details' procedure. So the 'form_trigger_failure' in my trigger is raised twice, causing the form to stop working. Please let me know if you have any idea on how to make the trigger execute only once.
---Form Builder version: 10.1.2.0.2

Thanks a lot
Re: Problem with Pre-Record trigger [message #264343 is a reply to message #263906] Mon, 03 September 2007 01:30 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Instead of the 'raise form_trigger_failure' put in a 'message('block is '||:system.current_block); pause' and see if the reason that you are getting the message twice is because you are getting a 'record_status' of 'new' on each of two blocks.

David
Re: Problem with Pre-Record trigger [message #264413 is a reply to message #263906] Mon, 03 September 2007 04:25 Go to previous messageGo to next message
dmel
Messages: 2
Registered: August 2007
Location: Athens, Greece
Junior Member
I put the message and it always prints 'B2'.
In the QUERY-MASTER-DETAILS procedure there is this code:
   ...
   Go_Block(detail);
   Check_Package_Failure;
   :System.Message_Level := '10';
   Execute_Query;
   ...

so it navigates to B2 with Go_Block, and then again with Execute_Query. It looks like there is no way to raise a form_trigger_failure on a detail block pre-record.

Thanks anyway.
Re: Problem with Pre-Record trigger [message #264901 is a reply to message #264413] Wed, 05 September 2007 00:19 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you considered having a 'count' so that it only fires the first time? By the way, why do you want it to stop processing?

David
Previous Topic: proble of content canvas
Next Topic: form date refresh
Goto Forum:
  


Current Time: Mon Dec 05 06:48:34 CST 2016

Total time taken to generate the page: 0.09250 seconds