NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Robert Iliuta on May 19, 2010, 05:11:14 AM
-
Hallo,
On my form the primary key is updated when the save button is pressed. I want before the record is saved on disk to prime one field with the value of the primary key value. I try to find the correct embed for get the value of the primary field but did not find.
Thank you,
Robert
-
On Form advanced tab tick on "Prime Auto Inc even if not necessary".
cheers
Bruce
-
Now it is ok, but this option will cause more orphans records inserted. There is any options before to write on disk to get the value of primary key ? This way I will prime my ID at the end.
Thank you,
Robert
-
>> There is any options before to write on disk to get the value of primary key ? This way I will prime my ID at the end.
No, the primary key value is created by the insert.
You can use the PostInsert / PostUpdate routine to change the record if you like, but you should fetch the record, change it, and write it back yourself. (The ID will be primed at this point for TPS, and also for SQL if you have the necessary Clarion support for priming auto-inc fields turned on for SQL.)
Cheers
Bruce
-
Hallo Bruce,
Yes this way is working. It's much better now because there will not be any orphaned records inserted.
Also is there any attention for this ? It is safe ? or it's better have a process that check for orphans records to delete them?
Thank you,
Robert
-
Hi Robert,
I'm not sure what you're asking?
cheers
Bruce