Home » Developer & Programmer » Forms » commit_form is not working in Called Form (Oracle Form)
commit_form is not working in Called Form [message #641655] Thu, 20 August 2015 00:07 Go to next message
malya
Messages: 22
Registered: August 2015
Location: Hyderabad, India
Junior Member
I am calling a form using call_form('form_name',no_hide,do_replace,no_query_only,PL_ID) where PL_ID has parameters to pass on to called form from calling form. Calling form in query mode, called form in changed mode.

I want to call form and modify the field and come back to calling form but commit_form is not working in called form.
Please help. Thanks in advance.
Re: commit_form is not working in Called Form [message #641656 is a reply to message #641655] Thu, 20 August 2015 00:28 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Could you describe what you are doing in the called form? How do you know that COMMIT_FORM is not working?

Note that COMMIT (COMMIT_FORM) checks blocks in a form. If you changed some table "manually" (regardless the declared blocks), then Forms thinks that there weren't any changes and does nothing. Therefore, try with STANDARD.COMMIT instead as it doesn't check anything - it just commits.
Re: commit_form is not working in Called Form [message #641674 is a reply to message #641656] Thu, 20 August 2015 03:32 Go to previous messageGo to next message
malya
Messages: 22
Registered: August 2015
Location: Hyderabad, India
Junior Member
Say form A - calling & form and B - called form

Actually, I want to modify a date field in calling form which is populated from database for a particular record in calling form(A). Since this field is not data block field of calling form(A), I can not modify it on the same form. I have another form(B) where the date field can be modified. That form is working fine when you open it individually not by call_form(A).

My requirement is to call this form(B) from calling form(A) and modify the field, and then come back to Calling Form (A) with new value in the field.

Please help. Thanks in advance.
Re: commit_form is not working in Called Form [message #641676 is a reply to message #641674] Thu, 20 August 2015 03:39 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Just make it modifiable in form A. Anything else is over-complicating the problem.
Re: commit_form is not working in Called Form [message #641681 is a reply to message #641676] Thu, 20 August 2015 03:50 Go to previous messageGo to next message
malya
Messages: 22
Registered: August 2015
Location: Hyderabad, India
Junior Member
I can't make it modifiable in the calling form since other transaction are yet to be saved and this modification is taking place before main commit.
Re: commit_form is not working in Called Form [message #641685 is a reply to message #641681] Thu, 20 August 2015 04:25 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
And that'll be why it's not working.
Transactions belong to sessions not individual forms.
So if you commit in form B it would force a commit in form A.
However I'm pretty sure from memory that in the case where there are open transactions in A forms simply doesn't allow commit in B.

You could make B start in a new session, in which case you could commit, but then you've got the problem of how to see the modified data in A.
You would have to execute_query to get the changed data and forms would force you to issue a commit before you do that.

So again - make it modifiable in A
Re: commit_form is not working in Called Form [message #641690 is a reply to message #641685] Thu, 20 August 2015 04:51 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Having just checked the docs:
If you have a form with outstanding changes and call another form then the called form runs in post-only mode. It can post data to the DB but not commit. When you come back to the caller and issue a commit there that will commit the changes from the called form.
Re: commit_form is not working in Called Form [message #641691 is a reply to message #641655] Thu, 20 August 2015 05:00 Go to previous messageGo to next message
malya
Messages: 22
Registered: August 2015
Location: Hyderabad, India
Junior Member
I changed it from Call_FORM to OPEN_FORM to make the called form in new session. This is working fine but Form A is not refreshed with below code.

From form A,

OPEN_FORM('FORM B',ACTIVATE,SESSION,PL_ID);
-- to make the page refresh once it comes back from Form B
GO_BLOCK('BLOCK'); -- block of form A
EXECUTE_QUERY;

but this is not happening. I have a button for execute_query in Form A, I am clicking that and it is refreshing the page.

Second thing, When I come back from Form B and commit Form A and close it, I can see Form B is also active. how to close Form B permanently.

Thank you for your great help.
Re: commit_form is not working in Called Form [message #641692 is a reply to message #641691] Thu, 20 August 2015 05:08 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well since open_form is to allow you to run multiple forms simultaneously the caller can't possibly wait for you to close the called form before it caries on processing. So that go_block and execute_query are run straight away before you have a chance to do anything in form B.

I would assume you close form B permanently the same way you would if you'd used call_form - click on the close window button. If that doesn't work then pass, I've never used open_form and aren't in a position to test it.
Re: commit_form is not working in Called Form [message #641695 is a reply to message #641692] Thu, 20 August 2015 07:09 Go to previous messageGo to next message
malya
Messages: 22
Registered: August 2015
Location: Hyderabad, India
Junior Member
I am managing to close Form B as soon as I save the data in Form B. And forcing user to refresh the Form A once he comes back to Form A. Its not the solution but my work is done.

Thanks for the useful ideas. Thank you so much.
Re: commit_form is not working in Called Form [message #641804 is a reply to message #641695] Mon, 24 August 2015 11:29 Go to previous message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Check the Forms Help on the 2 built-ins to see the difference between them and why you would use one over the other. The Open_Form() built-in is used when you have a multi-form application. The Call_Form() built-in is designed for the type of thing you are doing - calling another Form that the original Form needs input from. Both Forms are visible at the same time, but the "Calling Form" halts processing while the "Called Form" is open. Once the "Called" form exits, processing will continue in the "Calling" form.

Craig...
Previous Topic: WNRI
Next Topic: Logic for EDIT button
Goto Forum:
  


Current Time: Thu Apr 18 10:01:47 CDT 2024