Home » Developer & Programmer » Forms » FRM-40508 error after editing (Forms Version 6.0.8.11.3 )
FRM-40508 error after editing [message #388913] Thu, 26 February 2009 11:12 Go to next message
dude4084
Messages: 221
Registered: March 2005
Location: Mux
Senior Member
Hi

Objective: Upon entering first field of form, while entering a new record in a form, i come to know that that particular record exists. Now at this point i want to load the remaining field of the record and want to continue editing it.

Explanation: Assume i am entering record in famous emp table through a simple form.
When in empno field, i enter 7369, i come to know via alert in "when validate item " on empno field that this record already exist. Now at this point i want to edit it.

For this purpose, i select all remaining fields of emp table of record having empno=7369 and populate all the remaining fields in the form.
Then i did editing But upon issuing save command, its giving me FRM-40508 error.

Kindly help

-Dude

Re: FRM-40508 error after editing [message #388937 is a reply to message #388913] Thu, 26 February 2009 13:01 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If you want to EDIT a record, you have to work on that very record, not INSERT a new one (and that is exactly what you are doing now). In order to edit a record, you'll have to fetch it by using a query (EXECUTE_QUERY).

One way to do that is trivial - first execute a query to see whether such a record already exists. If not, cancel query and insert a record.

Another one might be setting the DEFAULT_WHERE block property and then execute a query. Though, as restricted procedures (and EXECUTE_QUERY is a restricted procedure) can not be run from the WHEN-VALIDATE-ITEM trigger, you'll have to find another way to do that.
Re: FRM-40508 error after editing [message #388995 is a reply to message #388913] Thu, 26 February 2009 21:57 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
In future, please post the error message as well as the error code!!

Are you serious in letting the users assign the employee number? This should be a sequence of one type or another.

David
Re: FRM-40508 error after editing [message #389016 is a reply to message #388937] Fri, 27 February 2009 00:18 Go to previous messageGo to next message
dude4084
Messages: 221
Registered: March 2005
Location: Mux
Senior Member
Quote:
Another one might be setting the DEFAULT_WHERE block property and then execute a query. Though, as restricted procedures (and EXECUTE_QUERY is a restricted procedure) can not be run from the WHEN-VALIDATE-ITEM trigger, you'll have to find another way to do that.


This what i have tried also. But you are right that restricted procedure can not be called in when-validate-item trigger. So i am in a fix.

My flow of work is like this:
When new empno is entered then check its existence in when-validate-item trigger. If it exists then have to edit it.

Now, after running when-validate-item and knowing that emp=7369 exists then WHERE can i call execute_query ?

In other words, restricted procedures can be called from which trigger?

-Dude
Re: FRM-40508 error after editing [message #389023 is a reply to message #388995] Fri, 27 February 2009 00:39 Go to previous messageGo to next message
dude4084
Messages: 221
Registered: March 2005
Location: Mux
Senior Member
djmartin wrote on Fri, 27 February 2009 08:57
In future, please post the error message as well as the error code!!

Are you serious in letting the users assign the employee number? This should be a sequence of one type or another.

David


With regrets, FRM-40508 means ORACLE error: unable to INSERT record.

As matter of fact, i usually try to present sample emp table while asking solutions for my problems. This help me to avoid typing my actual tables/data and other scenario.

The scenario i have presented matches with the requirement.

-Dude
Re: FRM-40508 error after editing [message #389648 is a reply to message #389023] Tue, 03 March 2009 00:42 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Okay, as this is a 'scenario' then try this.

Make the 'empno' field a non-database field on the control block and make that block the first block. make 'emp' the second block and create a 'When-New-Block-Instance' trigger on that block. Then when you 'move' from 'ctrl.ndb_empno' to 'emp_blk' the trigger will fire and you can use any command to either set the 'deafult_where' and do an 'execute_query' or test if the 'empno' exists, or whatever.

Give it a go and get back to us. You may have to play with the form level navigation to jump automatically between blocks.

David
Previous Topic: Forms Insatallation error
Next Topic: Unable to run forms
Goto Forum:
  


Current Time: Sat Dec 03 10:15:07 CST 2016

Total time taken to generate the page: 0.13196 seconds