Home » Developer & Programmer » Forms » Need to clear the form and execute a procedure in same trigger (Oracle forms 4.5)
Need to clear the form and execute a procedure in same trigger [message #522713] Tue, 13 September 2011 05:27 Go to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi all,

I have a problem in my form.
In my form there are 4 blocks and in one of the block i have a button. In which i put a code same as below:
BEGIN
     IF NAME_IN('SYSTEM.FORM_STATUS') = 'CHANGED'
     THEN
        CLEAR_FORM(NO_VALIDATE);
     END IF;
    PROCEDURE ABC;
END;


So as per code i want to clear all the changes in form for current session and want to call the procedure ABC after that.
But it is not calling the procedure ABC.

Could any one please let me know why this is not executing?
And what would i do to perform the same?

Regards,
Umashankar Jhajharia


[EDITED by LF: fixed topic title typo; was "rigger". Included [code] tags]

[Updated on: Thu, 15 September 2011 01:19] by Moderator

Report message to a moderator

Re: Need to clear the form and execute a procedure in same rigger [message #522715 is a reply to message #522713] Tue, 13 September 2011 05:35 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
What makes you believe it's not calling the procedure?
The only way that could happen is if clear_form raised an error. Do you have an on-error trigger?
Put messages before and after the clear_form command and at the beginning of ABC and see if they appear.
Re: Need to clear the form and execute a procedure in same rigger [message #522716 is a reply to message #522715] Tue, 13 September 2011 05:37 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Yes.
I already tested that.
Before CLEAR_FORM, the message is appearing but after that nothing is executing.
No message after running of clear_form.
Re: Need to clear the form and execute a procedure in same rigger [message #522717 is a reply to message #522713] Tue, 13 September 2011 05:38 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What is this
procedure abc;
line really? I suppose this is just an illustration, I don't think that procedures are called that way.

Also, the way it is written now, the procedure is executed nevertheless the form status is 'CHANGED' or something different. So - maybe the procedure uses certain values you cleared so it does nothing when these values are missing.

In order to debug it, put MESSAGE built-ins into this trigger, as well as into the ABC procedure so that you'd know what was (or was not) executed.
Re: Need to clear the form and execute a procedure in same rigger [message #522719 is a reply to message #522717] Tue, 13 September 2011 05:40 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
It would help if you showed us the real code.
Re: Need to clear the form and execute a procedure in same rigger [message #522720 is a reply to message #522719] Tue, 13 September 2011 05:47 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
And you didn't answer my question about the on-error trigger. If you have one delete it and try again.
Re: Need to clear the form and execute a procedure in same rigger [message #522724 is a reply to message #522720] Tue, 13 September 2011 06:19 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi Cookiemonster,

There is no 'ON_ERRO' trigger in block level but there is on form-level.

CODE:
-----
BEGIN
IF NAME_IN('SYSTEM.FORM_STATUS') = 'CHANGED'
THEN
message('start clearing of form');
CLEAR_FORM;
message('End clearing of form');
END IF;
message('Navigate to next-form now');
ABCD('NEXT-FORM');
END;

The code is as per upper one.
First message 'start clearing of form' is displayed.
After this both the messages are not displaying.

ABCD is a procedure which is taking another form name as argument which is being navigated by NEW_FORM in that procedure.
Re: Need to clear the form and execute a procedure in same rigger [message #522732 is a reply to message #522724] Tue, 13 September 2011 06:43 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
So delete the form level on-error trigger and try again
Re: Need to clear the form and execute a procedure in same rigger [message #522740 is a reply to message #522732] Tue, 13 September 2011 07:12 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Is there any other way to resolve this problem without deleting that on-error trigger.
Re: Need to clear the form and execute a procedure in same rigger [message #522745 is a reply to message #522740] Tue, 13 September 2011 07:37 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why is this code in an ON-ERROR trigger? What you are saying is: whatever error happens (and was not captured elsewhere), this trigger will. And what will you do? Clear this form and call another one.

Is this really the way you want to handle errors?
Re: Need to clear the form and execute a procedure in same rigger [message #522751 is a reply to message #522745] Tue, 13 September 2011 08:09 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Deleting the on-error trigger is a temporary measure to see if it's masking an error. So try it and see what happens.
Re: Need to clear the form and execute a procedure in same rigger [message #522855 is a reply to message #522751] Wed, 14 September 2011 04:45 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Hi all,

Please leave it all.
Just i want a solution on broad level.

I have a button on a form which is calling another form by using NEW_FORM. In this case if i am changing anything on first form, whenever i am pressing the button, it is showing a dialogue box as "'Do You Want To Call the New Form?'.

Now what should i do if, i dont want this message here to pop-up.

Thanks for your feedbacks.
Re: Need to clear the form and execute a procedure in same rigger [message #522863 is a reply to message #522855] Wed, 14 September 2011 05:10 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Have you tried calling it with the full_rollback parameter?
If that doesn't work then you probably can't get rid of that message.
Re: Need to clear the form and execute a procedure in same rigger [message #522867 is a reply to message #522863] Wed, 14 September 2011 05:16 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Can we write something by which all the changes performed in same session could be undo in same WHEN-BUTTON-PRESSED trigger ?
Re: Need to clear the form and execute a procedure in same rigger [message #522869 is a reply to message #522867] Wed, 14 September 2011 05:19 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Other than clear_form? Not that I can think of.
Re: Need to clear the form and execute a procedure in same rigger [message #522871 is a reply to message #522869] Wed, 14 September 2011 05:20 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Also, I suppose that "all changes" should have been "all uncommitted changes"?
Re: Need to clear the form and execute a procedure in same rigger [message #522876 is a reply to message #522871] Wed, 14 September 2011 05:43 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Yes.
I don't want to commit the changes in same session.
Re: Need to clear the form and execute a procedure in same rigger [message #522877 is a reply to message #522876] Wed, 14 September 2011 05:46 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Then you need to use clear_form, or if there's just one datablock clear_block should do.
Re: Need to clear the form and execute a procedure in same rigger [message #522880 is a reply to message #522877] Wed, 14 September 2011 05:51 Go to previous messageGo to next message
umesh337
Messages: 26
Registered: July 2011
Location: pune
Junior Member
Is it TRUE?
When i will use clear_form it will load the SAME FORM with new session.
And where will be the cursor of execution after clear_form statement.
Re: Need to clear the form and execute a procedure in same rigger [message #522885 is a reply to message #522880] Wed, 14 September 2011 06:11 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
clear_form clears all the items in the form. It doesn't load anything. It doesn't start a new session.
As for the cursor - try it and find out. 1st item in 1st block probably.
Previous Topic: Oracle Forms Triggers
Next Topic: JVM Configuration intead of Jinitiator
Goto Forum:
  


Current Time: Sat Sep 07 12:56:07 CDT 2024