Home » Developer & Programmer » Forms » frm-40737 illegal restricted procedure first_record next_record (Oracle forms, 6i, Windows)
frm-40737 illegal restricted procedure first_record next_record [message #401979] Thu, 07 May 2009 03:36 Go to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
Hello,

I have this problem :

In a block, when i insert a new record i have to check this record versus others records of the block. So i make a FIRST_RECORD;
LOOP
/*check*/
/*if ok nothing*/
/*if ko ask the user continue or cancel*/
/*continue will update the current record */
/*cancel will delete the newly inserted record */
NEXT_RECORD;
IF LAST_RECORD THEN EXIT; END IF;
END LOOP;

I have to make this action in the record level because i ask a action by the user on the record inserted.

But i can't use FIRST_RECORD; NEXT_RECORD; in any validate trigger. Is there an other way ?

Thanks
Re: frm-40737 illegal restricted procedure first_record next_record [message #401995 is a reply to message #401979] Thu, 07 May 2009 04:08 Go to previous messageGo to next message
Littlefoot
Messages: 20899
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Such a validation questions have been asked many, many times. Please, search the board to see what has been said about the issue.
Re: frm-40737 illegal restricted procedure first_record next_record [message #402013 is a reply to message #401979] Thu, 07 May 2009 05:17 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
exact,

Many post about illegal commit in validate trigger. The solution is to create a timer. No problem.

But built-in of navigation as first_record, next_record... cannot be placed in a timer because timers are asynchronous. So my problem is a little bit different.
Re: frm-40737 illegal restricted procedure first_record next_record [message #402036 is a reply to message #402013] Thu, 07 May 2009 06:44 Go to previous messageGo to next message
Littlefoot
Messages: 20899
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm afraid that you'll have to improve your search skills. Just wondering, which keywords did you use? My search returned 2 pages of more (or less) relevant topics.
Re: frm-40737 illegal restricted procedure first_record next_record [message #402042 is a reply to message #402036] Thu, 07 May 2009 07:11 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
I'm agree i'm not good at that. I made a search on "frm-40737 illegal restricted" results : 20 topics but no solution.

this topics deal with next_item; or commit; in validate trigger but no one about first_record; next_record; loop; (except mine)

Did you find relevant answer for my problem? what's your keywords ?
Re: frm-40737 illegal restricted procedure first_record next_record [message #402057 is a reply to message #402042] Thu, 07 May 2009 07:49 Go to previous messageGo to next message
Littlefoot
Messages: 20899
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Oh, come on! Try to be more creative! This is a good practice! If these keywords weren't good enough, find new ones.
Re: frm-40737 illegal restricted procedure first_record next_record [message #402689 is a reply to message #402057] Tue, 12 May 2009 01:42 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Why do you need this looping validation anyway? What do you want to validate? Think of a method which isn't trying to break the behaviour of Forms.

David
Re: frm-40737 illegal restricted procedure first_record next_record [message #402719 is a reply to message #402689] Tue, 12 May 2009 03:07 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
Hello,

I understand that it's not possible to do that in Forms, I'm trying to find an other solution.

I need to loop because i have read and check all records of the data block when i insert a new record. I can't check directly in the DB using SQL statement because some records are not commited.

Re: frm-40737 illegal restricted procedure first_record next_record [message #403190 is a reply to message #402719] Thu, 14 May 2009 02:26 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Then you understand wrong. You should have searched this forum for 'looping' and 'validation' and 'dynamic record group'.

Use a dynamic record_group to hold a copy of the records as you retrieve and enter them and then do your validation search against the record_group.

David
Re: frm-40737 illegal restricted procedure first_record next_record [message #403247 is a reply to message #401979] Thu, 14 May 2009 07:45 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
Hello,

I know how to populate a record group but how to search against the record group ?

Thank
Re: frm-40737 illegal restricted procedure first_record next_record [message #403700 is a reply to message #403247] Mon, 18 May 2009 03:03 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
Hello,

Actually I'd make a loop on all my records in a KNI trigger.

Someone knows how to force forms to always execute the KEY-NEXT-ITEM code ?
Re: frm-40737 illegal restricted procedure first_record next_record [message #404506 is a reply to message #403700] Fri, 22 May 2009 00:53 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Use the 'when-validate-item' trigger. It is the one that will fire everytime an item is changed.

David
Re: frm-40737 illegal restricted procedure first_record next_record [message #405152 is a reply to message #404506] Tue, 26 May 2009 10:55 Go to previous message
TonyJaa
Messages: 50
Registered: May 2009
Member
Hello,

I have found a solution without looping or dynamic record group, i would like to thank you all for helping me and of course share the solution with you.

1) instead of using commit; or commit_form; i use post; the data entered in the form are visible in a DB without to be commited. In a when-validate-record i put a timer which do post; --> data of the form and data of the DB are always synchronized.

2) then to validate the data i use sql statement. it tells me if its ok or not.

3) instead of loop each record to find the one i need to change i make a update statement; and a clear_block execute_query to refresh the form.

4) The user commit the data himself.

Is it a good way to validate multi-line block without commit each record ?

Thank
Previous Topic: Lock on record while Updating
Next Topic: procedure in oracle trigger
Goto Forum:
  


Current Time: Wed Dec 07 12:53:54 CST 2016

Total time taken to generate the page: 0.12774 seconds