NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Mike Grigsby on October 26, 2007, 11:59:24 AM

Title: Display of autoincrementing numbers not working
Post by: Mike Grigsby 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.
Title: Re: Display of autoincrementing numbers not working
Post by: Bruce 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
Title: Re: Display of autoincrementing numbers not working
Post by: Mike Grigsby 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.
Title: Re: Display of autoincrementing numbers not working
Post by: Bruce on October 31, 2007, 10:19:04 PM
Thread continued here
http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=234.0#new