Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170514] |
Thu, 04 May 2006 03:19 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
nirmalnarayan
Messages: 261 Registered: April 2005 Location: India
|
Senior Member |
|
|
I am having a form which have two blocks, one is a database block and another a non-database block.
I am having insert update statements written inside a program unit function, which is being called from KEY-COMMIT trigger.
It is working fine with Oracle standard menu, now the client wants to implement a separate menu, since there are many forms in the 'Save' menu option we are using commit_form command, but this is not working for the forms which have as said above KEY-COMMIT triggers written, what is the workaround for this issue.
Thanks,
Nirmal
|
|
|
|
Re: Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170540 is a reply to message #170532] |
Thu, 04 May 2006 05:01 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
nirmalnarayan
Messages: 261 Registered: April 2005 Location: India
|
Senior Member |
|
|
In the Key-commit trigger i am calling a function, called SAVE_FORM which returns a boolean value,
The following is the KEY-COMMIT trigger written at form-level.
Declare
formstatus boolean;
Begin
formstatus:=SAVE_FORM;
/** SAVE_FORM is function for inserting values to the table */
If formstatus=TRUE then
Message('Data saved successfully');
Message('Data saved successfully');
Else
Message('Data saving failed');
Message('Data saving failed');
End if;
END;
Inside the function i have the insert statements and update statements for the tables, of both the blocks, where the data should go and sit.
In the Menu i have a item 'Save', i have the following menu item code
Begin
commit_form;
End;
But on clicking this menu item on runtime the KEY-COMMIT trigger is not firing at all.
Thanks,
Nirmal
[Updated on: Thu, 04 May 2006 05:02] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170944 is a reply to message #170933] |
Sat, 06 May 2006 09:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
If I understood you well, you have:
- a KEY-COMMIT trigger
- a SAVE_FORM procedure
- a SAVE item (which contains one of "COMMIT" variations), for example
BEGIN
commit;
-- or standard.commit;
-- or commit_form;
END;
Now, why do you expect the code written above to fire the KEY-COMMIT trigger? It is triggered if you
a) press the key-commit key on the keyboard
b) call it explicitly from another trigger
As you didn't / don't want to / press the key-commit key, you'd have to call it in the procedure written on the "save" item. Something like this:
BEGIN
EXECUTE_TRIGGER('KEY-COMMIT');
standard.commit;
END;
However, if there are more than one KEY-COMMIT triggers (for example, one form-level, one (or several) block-level ones or even item triggers), it could be confusing when EXECUTE_TRIGGER(trigger_name) is found in the code.
It would, maybe, be a better idea to put the code currently written in the KEY-COMMIT trigger into a procedure and call it when necessary (from the KEY-COMMIT trigger, from the SAVE item, etc.).
|
|
|
Re: Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #171038 is a reply to message #170933] |
Mon, 08 May 2006 01:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Key-Commit ONLY fires if the form thinks that there has been a change. I can only assume that you have written your own Update and Insert statements. IF you want forms to do work you have to 'show' it that you have done something. The best way is to NOT use your own Inserts and Updates but get forms to do the work. Alternatively, set a field to itself and then you will have a change at the form level.
David
|
|
|