NetTalk Central

Author Topic: Submiting a record  (Read 3916 times)

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Submiting a record
« on: July 21, 2014, 09:39:52 AM »
NT 8.19
CL 9.0
Postgres

Any ideas on how to do the following please:

FIle Uploading

1.  Header record for Dictation Upload.  Has Patient name etc.
2. File Upload button on the form where customers can upload one or many files to the server
3. All saved in Blob fields in a detail record linked to the header above
4. I use 'EmulateAutoNumKey' in the options for the table - This acts like a TPS file auto increment and gives me the unique ID for the record before hitting the save button.
5. I now have the ID and can create the detail records with the blob no problem

This all works well except of course when the customer cancels the header record before completion.  Then a blank/partial record is now in the database looks very odd to the customer.

I was thinking to take the autoincrement out and have a Submit button of some sort that commits the record and gives me the ID?
If I make the user save the record and then only enable to upload it works fine, but I am trying to avoid the same and then open the record process.

Brian.
Brian

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11302
    • View Profile
Re: Submiting a record
« Reply #1 on: July 21, 2014, 09:54:45 PM »
I prefer to use Guid strings rather than numeric ID's to avoid this (and many other) issues. But this approach is controversial.

If you want to stick with auto-numbering then I'd add a field to the record called say "InsertComplete". This is 0 until they press OK. When they press Ok you set it to 1 (See Priming tab, prime on Save.)

You can "clean up" incomplete records as a background process which runs on a regular basis.

To make it more sophisticated I might add a "date added" and "time added" field - so I can remove incomplete records after a specific period of time (say 30 minutes) since they've been abandoned.

cheers
Bruce

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Submiting a record
« Reply #2 on: July 22, 2014, 08:46:22 AM »
Yes I remember your discussion on the GUID's and I think I will use that approach here.
Brian