Home » Developer & Programmer » Forms » How to Clear Record?
How to Clear Record? [message #543102] Mon, 13 February 2012 02:32 Go to next message
nandhiniprema
Messages: 10
Registered: February 2012
Location: Chennai
Junior Member
In a master and detail relation ship block..When a cursor is placed in the details and enter some thing and giving back space..once value is cleared a empty record is saved in the database with the header values...but in details custmer didnt enter anything...how to clear the detail record in pre insert or when validation...
Re: How to Clear Record? [message #543109 is a reply to message #543102] Mon, 13 February 2012 02:42 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If columns/items are declared as NOT NULL, then it is perfectly valid to save such records into a table. If you want them to be populated, then alter the table and make them NOT NULL (and set their "Required" Forms property to "yes").
Re: How to Clear Record? [message #543110 is a reply to message #543109] Mon, 13 February 2012 02:44 Go to previous messageGo to next message
nandhiniprema
Messages: 10
Registered: February 2012
Location: Chennai
Junior Member
Thanks a lot if we can make it not null it will work but customer requirement it should be null..
Re: How to Clear Record? [message #543116 is a reply to message #543110] Mon, 13 February 2012 02:54 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As I said, if columns are declared as NOT NULL (and customer's requirement says that it can be NULL), then why do you bother what they save?

If you insist, then you'll have to do it manually (for example, in WHEN-RECORD-VALIDATE or WHEN-ITEM-VALIDATE trigger). That's kind of tricky as you'll have to ask user whether it is really OK to save an empty record or not. If "not", then DELETE-RECORD and commit.
Re: How to Clear Record? [message #543123 is a reply to message #543116] Mon, 13 February 2012 03:09 Go to previous messageGo to next message
nandhiniprema
Messages: 10
Registered: February 2012
Location: Chennai
Junior Member
This is master screen here there is no probs if we save empty record..But in transaction for that particular master code ,detail code is checking and 'No_data_found' issue is raising.So in master we need to restrict by delete record or clear record when user attempt to keep cursor and enter valuses later if back space is give..

Re: How to Clear Record? [message #543323 is a reply to message #543123] Tue, 14 February 2012 02:37 Go to previous messageGo to next message
nandhiniprema
Messages: 10
Registered: February 2012
Location: Chennai
Junior Member
Hi i resolved the problem by adding go block with in loop and clear the particular record in Key commit.

[Updated on: Tue, 14 February 2012 08:11] by Moderator

Report message to a moderator

Re: How to Clear Record? [message #543333 is a reply to message #543323] Tue, 14 February 2012 03:27 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
You do realize that key-commit can be bypassed?
If you make changes and then exit the form then you will be asked if you want to save the changes. If you click yes then the changes will be saved to the DB without key-commit being fired.
You should never do any validation type processing in key-commit. In fact I have never yet found a use for that trigger.
Previous Topic: Cycle Reference in Oracle Form's Attached Libraries (merged 2)
Next Topic: how to join tables in a cursor
Goto Forum:
  


Current Time: Thu Sep 12 23:33:18 CDT 2024