Home » Developer & Programmer » Forms » problems while inserting a new record
problems while inserting a new record [message #79258] Mon, 20 May 2002 07:42 Go to next message
Luc
Messages: 11
Registered: January 2002
Junior Member
Hi, I'm facing a problem when I want to insert a new record. I create a new record, fill out the appropriate fields and afterwards I press the button "Save changes". Now when I have updated a record it works fine but when I have created a new one oralce won't insert it into the table. here is the code, I just don't know what I've done wrong.
The global variable is for controlling if I have updated a record or created a new one.

IF :system.form_status = 'CHANGED' OR :GLOBAL.INSERT_TEST = 1 THEN
IF SHOW_ALERT('SAVE_ALERT') = ALERT_BUTTON1 THEN
COMMIT_FORM;
ELSE
Clear_Block(No_Validate);
ISSUE_ROLLBACK(NULL);
EXECUTE_QUERY;
END IF;
END IF;

thx in advance.
Re: problems while inserting a new record [message #79260 is a reply to message #79258] Mon, 20 May 2002 08:04 Go to previous messageGo to next message
nik
Messages: 55
Registered: January 2002
Member
hi , this may help

IF :System.Record_Status IN ('CHANGED', 'INSERT') THEN
Commit_Form;
END IF;
Clear_Record;

_______________________________
I think you may have to check for sys.record status = 'INSERT' ( this indicates a new record (ie. INSERT)

nik.
Re: problems while inserting a new record [message #79262 is a reply to message #79260] Mon, 20 May 2002 12:07 Go to previous message
Luc
Messages: 11
Registered: January 2002
Junior Member
hi, nik I've implemented a new button on my block and when I write your code behind it's trigger it works but when I use the create_record button at the top it doesn't ??? I don't know why 1 does work and the other not but thanx alot, 1 out of 2 is good enough for me.

grtz.
Previous Topic: Re: report not giving output
Next Topic: Re: Serial communication with weigh-bridge
Goto Forum:
  


Current Time: Tue Apr 23 18:53:28 CDT 2024