Record not saved despite Transaction Successful message [message #669175] |
Fri, 06 April 2018 21:17 |
|
Ani747
Messages: 11 Registered: March 2018
|
Junior Member |
|
|
Hi Team,
Need your help in this.
I am working on a form with 3 data blocks (1 database and 2 Control Blocks).
This is the previous code I had written to Create (C)/Update (U) record and it worked fine :
if :choice='C' then
go_block('city4');
commit;
elsif :choice='U' then
commit;
end if;
standard.COMMIT;
However, I tried to reduce the excess statements by using :
go_block('city4');
Commit;
Now, when I try and add a new record, though i am getting the System generated message of "Transaction Successful, Record saved", it is not adding any new record in reality.
This is confusing as i tried swapping commit with Standard.commit in the new version, but still there was no change reflected
Please suggest.
Regards,
Ani
|
|
|
Re: Record not saved despite Transaction Successful message [message #669178 is a reply to message #669175] |
Sat, 07 April 2018 03:15 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
IF-THEN-ELSE you wrote is useless. COMMIT affects the whole form, you can't restrict it to one block.
COMMIT, i.e. COMMIT_FORM analyses the form, searching for changes you might have made. If you changed something, it'll save it into the database. However, if you did "manual" modifications (such as INSERT INTO or UPDATE in your form triggers or procedures), COMMIT will conclude that nothing changed and that there's nothing to be saved, and will inform you with the "No changes to save" message.
STANDARD.COMMIT bypasses all analyses and does what you said: commit, right now!
Therefore,
a) get rid of your own code and use built-in Forms committing (such as F10, Ctrl + S, yellow floppy disk toolbar icon)
b) if you must, use STANDARD.COMMIT
|
|
|
|
|
|
|
|
|
|
|
Re: Record not saved despite Transaction Successful message [message #669252 is a reply to message #669250] |
Tue, 10 April 2018 02:51 |
cookiemonster
Messages: 13961 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Well you're doing something wrong.
But since you've told us virtually nothing about what your form does it's not possible for us to even guess what.
If you want help you're going to have to describe what you have - what blocks you've got and whether they are database blocks. What triggers are involved and if you've got hard-coded inserts/updates where they are in the code and what they do.
|
|
|