Jump to content
Salesforce and other SMB Solutions are coming soon. ×

how to create serial # after import


963
 Share

Recommended Posts

hello everyone

I have a DB with many records. I need a script that can assign serial numbers to the records after I find the record

1,2,3 and so on and so fort confused.gif

I know it must be very simple but I can not get it to do this

 

Thanks smile.gif

Link to comment
Share on other sites

If I understand your question correctly, one option would be to assign them during the import. You get an dialogue box for auto-enter option right before the actual import.

Link to comment
Share on other sites

If you are using the file in single user mode, you can store the next serial value in a global field, and set your serial numbers with a script that runs along the lines of:

 

[/b]Set Field ["Serial#", "gNextSerialNumber"]

Set Field ["gNextSerialNumber", "gNextSerialNumber + 1"][/b]

 

If you need the funtionality to hold up in Multi-User mode (where global fields are not shared and only host global field changes are saved) you can do so by:

 

1. Using a number field in a related 'global values' file (where the relationship is based on a calculating constant field - eg with the formuls set to 1 - in both files) and referencing it with a similar script, viz:

 

[/b]Set Field ["Serial#", "GlobaValues::NextSerial"]

Set Field ["GlobaValues::NextSerial", "GlobaValues::NextSerial + 1"][/b]

 

or

 

2. You can set up a self join relationshiip (using a calculating constant field and matching it to itself) then use the formula:

 

[/b]Set Field ["Serial#", "Max(SelfJoin::Serial#) + 1"][/b]

 

This latter method will work well, but be aware that if your file size is (or will become) large (eg 10,000 records upwards) the Max( ) calculation may become noticeably slower to execute, as it will have to 'canvas' 10,000 records each time it computes.

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use