February 25, 200520 yr I am working on an order entry application. When a user creates a new order, I didn't want the order number to be generated until she hit a confirm button that performed a commit statement. I set up the Order# to be auto entered serial # on commit. I create a new order and start entering in info into some of the fields. If I click out of a field, the order # is generated. Is there a way to force the commit to not happen until they hit the confirm button? Thanks! John
February 25, 200520 yr If you force your user to use a script to commit the records, you can build in there something like: If [for whatever reason the record is not going to be created after all] Commit Records/Requests [] #to make sure the Serial number indeed gets created before being reverted; the user could also decide to 'undo' this record before it gets committed #(I guess this step could be skipped if you ask the serial number to be created 'upon creation' rather than 'upon commit', but it won't do any harm) Set Next Serial Value [YourTable::YourSNField;GetNextSerialValue("YourFile";"YourTable::YourSNField") - 1] #you ask what the next serial number is going to be, then tell FM that the sn for the next record is in fact going to be one lower than that Delete Record/Request [no dialog] #this never happened, OK? End if
Create an account or sign in to comment