Home » Developer & Programmer » Forms » Commit_form does not commit (Oracle forms 6.0.0.11.3 Windows XP)
Commit_form does not commit [message #535955] Sun, 18 December 2011 02:17 Go to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
Hi

I am calling a child form from a parent form.

Problem area:

It works perfectly if the parent form is adding records and while entering records when i press the button to call the child form, the whole things work perfectly according to plan.

The problem begins when i run execute query command in the parent form and then call child form then it does not "commit_form". So this is my problem that child form does not work perfectly when parent form is being called in execute_query procedure.



My working:
1) I read in the documentation that
When parent form status is query_only then child will also have the same mode regardless of the parameter given in call_form
So i checked the :SYSTEM.FORM_STATUS of both the parents and child form,it shows "CHANGED" hence this point is covered. (dont know how come the parent form is in changed status but at least it is doing my work)

2) I further read and found that
Commit_form procedure make the :SYSTEM.FORM_STATUS as QUERY. Here i am facing problem as in child form when i make changes
and press commit form. Then before commit_form and after commit_form the :SYSTEM.FORM_STATUS results in "CHANGED".
You can see this in the following code which i have written in save button.

message(:SYSTEM.CURRENT_FORM || ' a ' ||:SYSTEM.FORM_STATUS); pause;
commit_form;
message(:SYSTEM.CURRENT_FORM || ' b ' ||:SYSTEM.FORM_STATUS); pause;


 IF Form_Success THEN
 	Commit;
 	IF :System.Form_Status <> 'QUERY' THEN
 		Message('Error prevented Commit');
 		RAISE Form_Trigger_Failure;
 	END IF;
 	else
 		message('FAIL');
 END IF;
exit_form;



then at last exit_form module shows that" i have unsaved data in the form" save Yes-No-Cancel?



Kindly guide me how to track this problem.

Thanks
Re: Commit_form does not commit [message #535977 is a reply to message #535955] Sun, 18 December 2011 13:16 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It seems that Forms think that something changed. Check what's been said here. Whichever option you choose, you'd put it in front of EXIT_FORM.
Re: Commit_form does not commit [message #535986 is a reply to message #535955] Sun, 18 December 2011 14:50 Go to previous messageGo to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
Just forgot to mention that

Quote:
Then before commit_form and after commit_form the :SYSTEM.FORM_STATUS results in "CHANGED".


The form is NOT committing the changes which is agaisnt my desire.


Dear Little foot,

I will give you the output soon as per your reply though i have tried set_item_property (item_is_valid) before but failed.


The basic problem seems that commit_form is NOT saving/committing data.
Re: Commit_form does not commit [message #535989 is a reply to message #535986] Sun, 18 December 2011 15:06 Go to previous messageGo to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
Quote:
message(Get_Record_Property(1,'prod1',STATUS)); pause; --resulting in changed
set_record_property(:system.trigger_record, 'prod1', status, changed_status);


Even this is not working for me.
I can not figure out that if the record/form status is "changed" then why commit_form is not committing data? what is the reason?
(though in 1st situaion, as expained above, it works perfectly and commits form + shows "query" as form status after commit)

Re: Commit_form does not commit [message #536031 is a reply to message #535989] Mon, 19 December 2011 00:56 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What kind of data are you trying to commit in a child form? Is it data entered into form items, or did you manually (in a trigger or a procedure) write your own INSERT INTO ... statement?

Perhaps you could try with STANDARD.COMMIT instead of COMMIT_FORM and see what happens.
Re: Commit_form does not commit [message #536051 is a reply to message #536031] Mon, 19 December 2011 02:24 Go to previous messageGo to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
Dear Little Foot, thank you for your precious time.

The STANDARD.COMMIT is also not working.

My basic theory is that in parent form when entering products and loading its defualt prices in invouce form, if the user want to change the defulat price from master table then he will click a button to call the child form (passing prodcut code as parameter)
In child form, i used EXECUTE_QUERY with DEFAULT_WHERE. Then the user change the defualt price of the product and press OK button to return back to parent form.

Now there are two situations:
1) Parent form is entering new records:.... then the child form works perfectly. No problem at all.
2) Parent form is in execute_query mode to load the previous invoice number:..... Now i know that parent form is in execute_query mode but a simple :productname:=:productname can change its forms mode from "query" to "changed". I have checked the form status with following command right before calling the child form.

Quote:
message(:SYSTEM.MODE || ' <<>> ' || :SYSTEM.FORM_STATUS); pause;


But do not what happens afterward that child form refuses to work properly.
Everything else seems to be right except commiting data to database. I saw the form in debud mode too. Nothing is being called at the time of commit_form;

My further observation:
A) In situation 1) everything is good. The form status changes to query after committing but in situion 2 it remains changed.
B) Is anything i am missing in Parent form to change?

Still looking help !!
Re: Commit_form does not commit [message #536081 is a reply to message #536051] Mon, 19 December 2011 03:28 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How exactly do you call a child form? Could you post that statement?
Re: Commit_form does not commit [message #536111 is a reply to message #536081] Mon, 19 December 2011 04:28 Go to previous messageGo to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
CALL_FORM('FM_PROD_PRICE',no_HIDE,no_REPLACE,NO_QUERY_ONLY,PL_ID);
Re: Commit_form does not commit [message #536117 is a reply to message #536111] Mon, 19 December 2011 05:08 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Nope, that doesn't help. Really strange ... I can't think of any other reason, sorry.

My last suggestion (for the time being) would be: try to recompile both parent and child forms (Ctrl + Shift + K) and run them again.
Re: Commit_form does not commit [message #536184 is a reply to message #536117] Mon, 19 December 2011 12:17 Go to previous messageGo to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
Hi
Ctrl+shikft+K has also failed.

I thought for the further post mortem. I made a simple form on the basis of product master.
I run the form and did "execute_query".
Now when I clicked the button to call the child form, I noticed that
message(:SYSTEM.MODE || ' <<>>' || :SYSTEM.FORM_STATUS); pause;

has resulted in Normal<<>>Query .
The child form loaded and it worked PERFECTLY.
Hence the inference is
1) The child form was not in query-only mode even the parent form was in query mode. (is there any difference between QUERY and QUERY-ONLY mode?)
2) It has clearly broken the following rule as the child form is updating data.
Quote:
Form Builder runs any form called from a form in query-only mode as a QUERY_ONLY form, even if the CALL_FORM or NEW_FORM syntax specifies that the called form is to run in NO_QUERY_ONLY (normal) mode.
3) In my main problem
message(:SYSTEM.MODE || ' <<>>' || :SYSTEM.FORM_STATUS); pause;
has resulted in NORMAL<<>>CHANGED right before call-product. Can I change the form_status from "changed" to "query" ?
4) One more weird thing just found that my original parent form is also giving NORMAL<<>>CHANGED when calling the child form during situation 1) i.e. when Parent form is entering new records:.... and is WORKING PERFECTLY. and same NORMAL<<>>CHANGED in situation no 2 and is NOT WORKING
5) Still could not figure out that what thing causes problem in situation no 2?
Re: Commit_form does not commit [message #536625 is a reply to message #535955] Wed, 21 December 2011 22:25 Go to previous messageGo to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
is there any difference between QUERY and QUERY-ONLY mode?
Re: Commit_form does not commit [message #536636 is a reply to message #536625] Thu, 22 December 2011 00:10 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Certainly.

QUERY (as :SYSTEM.FORM_STATUS) indicates that a query is open. The form contains at least one block with QUERY records and no
blocks with CHANGED records.

QUERY_ONLY (as Forms runtime mode) means that users will be allowed to query, but not to insert, update, or delete records. That's why I asked you to specify the way you call the second form (your message #536111) - it is CALL_FORM (NO_QUERY_ONLY) mode, so I guess that it is not a culprit.
Re: Commit_form does not commit [message #575734 is a reply to message #536636] Sat, 26 January 2013 04:06 Go to previous messageGo to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
I found the reason today. The execute query was re validating the text box having LOV and hence making the parent form status as CHANGED.

Solution: i used set_item_property (item_is_valid) and hence 1 year old problem is solved today Smile

Re: Commit_form does not commit [message #575737 is a reply to message #575734] Sat, 26 January 2013 04:35 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Whoa! Thank you for letting us know!
Re: Commit_form does not commit [message #584919 is a reply to message #575737] Mon, 20 May 2013 08:13 Go to previous messageGo to next message
daringbadal
Messages: 2
Registered: May 2013
Location: New Delhi
Junior Member

Hi
m getting similar issues in my Oracle 10g form.

on which trigger and on which form i have to write

set_item_property ('item', item_is_valid, property_false);

Please help!!!

Regards

Badal
Re: Commit_form does not commit [message #584961 is a reply to message #584919] Mon, 20 May 2013 15:01 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That would be current form (obviously) and item's WHEN-VALIDATE-ITEM trigger.
Re: Commit_form does not commit [message #585217 is a reply to message #584961] Thu, 23 May 2013 01:19 Go to previous message
daringbadal
Messages: 2
Registered: May 2013
Location: New Delhi
Junior Member

my issue is resolved....

Thanks Dear bluetooth...
Previous Topic: set_lov_property with respect to list item
Next Topic: Canvases..
Goto Forum:
  


Current Time: Sun Jun 02 13:46:12 CDT 2024