Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I am working on a set of scripts to import some data from excel. I am trying to create a serial number in a blank field. Example. I have a voucher #R8387. I want the next record to show R8388 etc.. This is not an auto-entry field and do not want it to be. I cannot set it up in Excel the data is actually 2 types. I need to set up a serial number for one type and another number for another type.

Any help is appreciated.

Cin

Posted

I didn't quite follow your situation, but I will take a shot:

One approach is to create multiple fields. I don't know why you don't want to use autoenter, but you could create two fields with autoenter, one for each type of data, and a third calculation field that "reads" the first two and "decides" which one to use. Such as

Type_One_Data (autoenter serial number "R8387" increment one)

Type_Two_Data (autoenter serial number "T0001" increment one)

Serial_Number = If (not isEmpty (Type_One_Data), Type_One_Number, Type_Two_Number)

If you really don't want to use auto-enter, then you'll probably want a script that loops through and uses Set Field. Have a global field that holds the Next_Serial_Number. Do a search for every entry with no serial number. Then:

Go To Record(First)

Loop

Set Field (Serial_Number, Next_Serial_Number)

Set Field (Next_Serial_Number, Next_Serial_Number + 1)

Go To Record (Next)

End Loop

Something like that.

If this doesn't solve your problem, please clarify what you need.

Posted

The reason why I'm not using an autoenter field here is because it changes depending on the type of entry it is. I did find a reference of using the loop entry like you suggested. I used

Loop

Set Field (order#,Rvoucher)

Set Field (Rvoucher, abs(texttonum(rvoucher))+1)

Set Field (Rvoucher, "R" & Rvoucher)

Thanks!

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