Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto increment function for non primary key field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00572783
Message ID:
00577019
Vues:
27
>Oscar,
>
>Actually, the NewID() function is designed to generate values for other fields in addition to the primary key field. All you need to do is:
>
>1. Add a new record to the NewID() table for the field. Name it something other than the table name which you normally use for the primary key (for example "Table_MyField").
>
>2. Set the default value of the field to NewID("Table_MyField"). This guarantees that the value will be generated if someone manually adds a record to the table.
>
>3. Add code to the business object to execute NewID()...possibly in the PreSaveHook() of the business object if you don't want to skip IDs.
>
>Regards,
>Kevin

Thanks Kevin!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform