
Use the NumberGenerator.GetUniqueNumber() method to create unique IDs for the database records. This is used to initialise the primary keys with a unique number.
Use the following table definition for the NumberGenerator exmaples:

eFormNew expression:
efID = NumberGenerator.GetUniqueNumber()
cbDept.SetSelection(0)
rbMale = 0
efFname = ""
efLname = ""
efSalary = ""
signature1.Reset()
dtBday = DateTime.Now()
cbDept = ""
signature1 = ""
Link eFormNew expression to the Action – New property of the cursor form.
Data bind the form controls to the table columns accordingly.
Note:
efID – a form control that is not visible. A form variable can also be used to store the unique number.
All other code in the expression is just initialising and resetting the form controls to zero or the empty string.
tempID = NumberGenerator.GetUniqueNumber()
Database.Reset()
Database.AddColumn("ID", tempID)
Database.AddColumn("FNAME", efFname)
Database.AddColumn("LNAME", efLname)
Database.AddColumn("DEPT", cbDept)
Database.AddColumn("BDAY", dtBday)
Database.AddColumn("GENDER", rbFemale)
Database.AddColumn("SIGNATURE", signature1)
Database.AddColumn("SALARY", efSalary)
Database.AddRecord("EMPLOYEE")
//add code to initialise/reset form controls
Note:
Link this expression to the Action-Click property of a Save button on the form.