Jump to content
Server Maintenance This Week. ×

Question on auto entered serial # on commit


This topic is 7000 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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? wink.gif

End if

Link to comment
Share on other sites

This topic is 7000 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.