Jump to content
Sign in to follow this  
grahamb

Exporting a incremental line number

Recommended Posts

I'm trying to export a file from our FileMaker-based POS to send to the University's PeopleSoft finance system. One of the requirements is "a sequential number starting with 1 for the first line and incremented by 1 for each subsequent line" -- i.e. a line number. This wouldn't be a serial number stored within the record (each record already has one) but would be within the found set (the first found record is 1, the second in the found set is 2, etc).

Is there a way to do this? I looked at the status functions and couldn't see anything that looked like it would work. I could write a script that would loop through each record, setting a numeric field to the value of the previous record's field + 1, but I'd like to do something cleaner if possible.

Share this post


Link to post
Share on other sites

You could create an UNSTORED calculation field, Status(CurrentRecordNumber), then export that. It would of course only be the same for that particular found set. So what happens next time you export, and the records start with 1 again? I can't imagine that's what they want; but I don't know.

If they want a "unique" sequential number, that's a different thing. You could do it with a loop; but you'd have to go check what the last export ended with.

Tip for loops: View as Form, much faster.

Share this post


Link to post
Share on other sites

Brilliant! That worked perfectly. I had actually tried Status(CurrentRecordNumber) earlier but had forgotten to make it unstored. blush.gif

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Who Viewed the Topic

    2 members have viewed this topic:
    FMDuck  jools 
×

Important Information

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