NetTalk Central

Author Topic: Display of autoincrementing numbers not working  (Read 3392 times)

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Display of autoincrementing numbers not working
« on: October 26, 2007, 11:59:24 AM »
Any ideas why my autoincrementing numbers won't display when adding a new record? I've got them set as Display, and they do auto-increment when saved, but they show as zero ('0') on the form. The Example App 21 does it correctly, but I don't see anything different between what I'm doing. They look fine on the browses.
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11197
    • View Profile
Re: Display of autoincrementing numbers not working
« Reply #1 on: October 29, 2007, 06:12:47 AM »
Hi Mike,

To answer this it's worth recapping a bit on how Auto-numbering works.

In Clarion the record is added when the form is opened, then the record is either updated (on save) or deleted (on cancel). This creates the potential for small holes in the numbering to exist, but for most situations this is acceptable.

Of course on the web the user may not Save, or Cancel. They may close the browser. Or go to some other page and so on. So if NetTalk does the same as a Windows program then there's a lot more risk of "abandoned" records. So, where possible, it prefers NOT to do the Insert / Update or Delete approach, but rather does the Insert when the Save is pressed.

If you want to enforce the Win32 approach then go to the Advanced tab on the form and tick on "Prime Auto Inc".

But then why does Example 21 work? No it doesn't have the option ticked on. what happens is that NetTalk is aware that in some cases we need the ID in order to add child records to the form. So IF you have a browse on your form, then the Win32 approach is done (or to put it another way, If you have a Browse on your Form, then it's the same as ticking the Prin Auto-Inc option ON).

Cheers
Bruce

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Display of autoincrementing numbers not working
« Reply #2 on: October 29, 2007, 12:12:02 PM »
Bruce, Thanks, I think I follow. So it WILL autoincrement if the PrimeAutoInc is checked? Mine does not do that.

Also, on your example 31, all the procs seem to be coded much the same. The customers and invoices autoincrement the number and display it, but the UpdateProducts proc does NOT display the number. Is there a difference between the Product form and say the Customer or Invoice form? I can't see one.
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11197
    • View Profile