0

I have created an Form with Oracle Form Builder, when trying to insert data through the form in my DB table. Although Data is getting inserted and the success message kept by me is also comming but whne I am trying to close the Form, Oracle popup is coming asking if I want to save the changes,though I already have commit in code after insert of data, and getting Oracle error if I click YES. Please help me in understanding the problem here and please help with the solution also.enter image description here enter image description here enter image description here

Also please help me with any proper PDF or free course/site for learning Oracle Form Development.

1
  • First, click "Help" and then "Show error" - that should provide more details about what went wrong. If not, run form in debug mode so that you could follow its execution and find what caused error. Usually, question Forms asked ("Do you want to save the changes ...") is raised because some trigger modified base field which made Forms ask that question; otherwise, you'd lose data you inserted. Commented Sep 6, 2023 at 19:01

1 Answer 1

0

Short Answer: Try EXIT_FORM(NO_VALIDATE);.

Long Answer: It seems you may be handling the inserts yourself manually versus letting the form do it automatically upon committing. If you are using a database data block, the form will be prepared to save and/or insert any changes. If you go to leave, it will recognize that changes were made, but committing was not performed.

There are really a few ways to approach this, such as figuring out why the insert error is occurring and letting the form handle the updates. Since you already have working inserts and are confident that what needs to be saved is saved, then it may be best to simply bypass the error.

In the ON-EXIT trigger, or wherever you have the line of code that attempts to exit the form, I imagine you have a line calling EXIT_FORM;. Try adding the NO_VALIDATE option to that call EXIT_FORM(NO_VALIDATE);. This will ignore that check for changes and simply exit the screen. You can even use this in calls to EXECUTE_QUERY. I recommend using the built-in help tools to see the different types of options you have. One may come in handy in another scenario.

Keep in mind that this approach will not stop the insert error from occurring if the user is able to attempt to save the form by other means. We are only ignoring the check which prompts the message, which leads to the error if you say "YES". One way to keep the inserts and updates from occurring automatically, again without forcing you to abandon your already working code and use the built-in functionality, would be to add ON-INSERT and ON-UPDATE triggers to your block and simply enter NULL; so that they essentially do nothing.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.