Home » Developer & Programmer » Forms » Forms issue-KEY-COMMIT, COMMIT_FORM issue
Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170514] Thu, 04 May 2006 03:19 Go to next message
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 #170532 is a reply to message #170514] Thu, 04 May 2006 04:42 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Nirmal,

Sorry but I think we need more information.

Please describe, or attach a 256-colour screen shot, of your menu, and also include the code you currently have in your 'commit' trigger.

David
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 messageGo to next message
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 #170549 is a reply to message #170514] Thu, 04 May 2006 05:32 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why are you writing your own insert and update statements? Why don't you base your blocks on the real tables?

David
Re: Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170732 is a reply to message #170549] Fri, 05 May 2006 00:24 Go to previous messageGo to next message
nirmalnarayan
Messages: 261
Registered: April 2005
Location: India
Senior Member
The block is based on a complex view, so the requirement to write our own insert / update statements,

Thanks

Nirmal
Re: Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170736 is a reply to message #170732] Fri, 05 May 2006 00:46 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Instead of 'commit_form' use 'standard.commit'.

David
Re: Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170747 is a reply to message #170736] Fri, 05 May 2006 01:15 Go to previous messageGo to next message
nirmalnarayan
Messages: 261
Registered: April 2005
Location: India
Senior Member
But one more doubt, as the menu will be general for all the forms, both with database blocks and non-database blocks, will the 'standard.commit' work with all kind of forms or it has any restrictions ?

Thanks,

Nirmal
Re: Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170806 is a reply to message #170747] Fri, 05 May 2006 04:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
No restrictions, it is a COMMIT, NOW, NO QUESTIONS.

Try it and see.

David
Re: Forms issue-KEY-COMMIT, COMMIT_FORM issue [message #170933 is a reply to message #170806] Sat, 06 May 2006 08:24 Go to previous messageGo to next message
nirmalnarayan
Messages: 261
Registered: April 2005
Location: India
Senior Member
I tried standard.commit.

But standard.commit is not at all causing the KEY-COMMIT trigger to fire, as required.

Thanks,

Nirmal

[Updated on: Sat, 06 May 2006 08:25]

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 messageGo to next message
Littlefoot
Messages: 21818
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
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
Previous Topic: package
Next Topic: how use Esc ,F2,F1 button in my form
Goto Forum:
  


Current Time: Fri Sep 20 09:45:13 CDT 2024