Jump to content

reset serial number via script step

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

Recommended Posts

I have created a script to build IP addresses when creating a network. The script utilizes a field called IPserial which is set to auto enter a value starting at 1 and incrementing by one until it reaches 254. these make up the last digits of the IP address. However once all number have been generated i would like to reset the initial value to 1 so the next network i build i can simply run the script.

My question then becomes: Is it possible to reset the auto enter serial number via a script step?

thanks in advance for any help

Link to comment
Share on other sites

Hi jhomer,

Under Fields script-steps, see Set Next Serial Value.

Specify Field - yourSerialField and just put a 1 in the calc box. wink.gif


Link to comment
Share on other sites

I am having a problem setting the serial via a script. The script steps where I try to do this are:

Go To Record/Request/Page [First]

Set Next Serial Value [Table::Serial; Table::globalfield]

Replace Field Contents [No dialog; Table::Serial; Serial numbers]

But it ignores what I set and just uses whatever is in the entry dialog already, and it doesn't matter whether I use the "Custom Values" or the "Entry Options" setting (I also notice that the 'update entry options' box stays greyed out - I'm not really sure why, and actually I'm not sure what the Entry Options is supposed to do, it really isn't described in the online help at all).

It is a problem to try to set this with a globally stored field? And what is "Entry Options" and how do you use it? What am I doing wrong?

Link to comment
Share on other sites

"Entry options" means that you want to use the currently set "Initial value" and "Increment by" in the field definition.

Set Next Serial Value[] first, then Replace Field Contents[] with "Entry options" should work. It's hard to say what you're doing wrong without seeing the actual dialog box entry.

BTW, it's not necessary to go to the first record. Just make sure all the records you need are found and in the desired order.

Link to comment
Share on other sites

To my knowledge, Set Next Serial Value will only effect the records you create after using the step. To update existing ones, I would use something like

Replace Field Contents[ No dialog; Table::Serial; Table::globalfield + Get(RecordNumber) - 1]

Set Next Serial Value[Table::Serial; Table::globalfield + Get(FoundCount)]

Link to comment
Share on other sites

This topic is 6815 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.