key from new record
Posted: Tue Nov 28, 2017 5:06 pm
Why does a foundset not return the key of a new record?
So I want to save the key of the new record in FS in a FK column in CFS. But FS.id is empty after the saveData. Why does it lose it's record after saving and why does it not automatically return the primary key after making a new record?
How can I get the id of FS easily and reliably to store in CFS?
- Code: Select all
FS.newRecord( );
FS.value1= "some value";
FS.value2= "some other value";
FS.value3= "another value";
databaseManager.saveData( FS );
CFS.FK= FS.id;
So I want to save the key of the new record in FS in a FK column in CFS. But FS.id is empty after the saveData. Why does it lose it's record after saving and why does it not automatically return the primary key after making a new record?
How can I get the id of FS easily and reliably to store in CFS?