Home » Developer & Programmer » Forms » key-commit or pre-insert (oracle 10g R2, windows7)
key-commit or pre-insert [message #547060] Mon, 12 March 2012 02:23 Go to next message
7anona
Messages: 72
Registered: February 2012
Member
hello every one.
I had my form with 2 blocks( parent and child)and key-commit trigger which checks all the fields are filled and then it commits. The problem is when deleting a record in the child block and click the save button the trigger prohibit the user from saving the changes and a predefined message appears (please fill all fields). please guide me if i should use a different trigger or another trigger for the delete process
another question does key-commit trigger commit after executing the code in the trigger?
Re: key-commit or pre-insert [message #547075 is a reply to message #547060] Mon, 12 March 2012 03:28 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"Check" whatever you want in WHEN-VALIDATE-RECORD trigger, not in KEY-COMMIT. If you Search the board, you'll find that KEY-COMMIT can be bypassed (and, thus, never executed).

KEY-COMMIT will commit if you put "COMMIT" into it.
Re: key-commit or pre-insert [message #547160 is a reply to message #547075] Tue, 13 March 2012 03:11 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
thanks littlefoot I haven't use WHEN-VALIDATE-RECORD I tried to use pre-insert and it worked for both saving and deleting
Re: key-commit or pre-insert [message #547168 is a reply to message #547160] Tue, 13 March 2012 04:16 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
How can pre-insert work for deleting? It doesn't fire when you delete.
Re: key-commit or pre-insert [message #547396 is a reply to message #547168] Wed, 14 March 2012 02:35 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
I used key-commit previously to execute a code to insure all field are filled before saving. However when I delete and then click save to save the deletion process the key-commit trigger fires and a message appear to fill all the fields. so I couldn't delete. when I used preinser instead the trigger checked that field are filled and didn't restrict deleting
Re: key-commit or pre-insert [message #547414 is a reply to message #547396] Wed, 14 March 2012 04:06 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you're checking fields are filled in you should probably just use the required property - that's what it's there for.
Assuming any fields that need to filled on insert also need to be filled on update WHEN-VALIDATE-RECORD makes more sense than PRE-INSERT.
Re: key-commit or pre-insert [message #547417 is a reply to message #547414] Wed, 14 March 2012 04:21 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
thanks for the information actually I haven't try to use this trigger, I didn't know what it's for!!
Re: key-commit or pre-insert [message #547420 is a reply to message #547417] Wed, 14 March 2012 04:24 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
Read the form builder help topic on the trigger, and the one titled "About Validation".
You learn that stuff and you'll understand forms better than most people posting here.
Re: key-commit or pre-insert [message #547426 is a reply to message #547420] Wed, 14 March 2012 04:50 Go to previous message
7anona
Messages: 72
Registered: February 2012
Member
Smile I will
Previous Topic: FRM-41827:Group does not exist.
Next Topic: Radio Group - Put not visible one item of it
Goto Forum:
  


Current Time: Fri Jul 05 23:16:41 CDT 2024