Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

My solution has invoice numbers with five digits followed by a letter. I'd like to let my users preview what the subsequent invoice number in a particular series would be, before it's created (why? Long Story).

In other words, if invoices 20000a, 20000b, and 20000c exist, then I want a tooltip to show that the next invoice to be created in the 20000 series would be 20000d. Auto-enter serial numbers are not being used, btw.

I'm working on a formula that's getting me close:

Let ( [

trailingLetter = Right ( invoiceNumber ; 1 ) ;

trailingLetterAsNumber = Position ( "abcdefghijklmnopqrstuvwxyz" ; trailingLetter ; 1 ; 1 ) ;

trailingLetterPlusOne = trailingLetterAsNumber + 1 ;

subsequentLetter = GetAsText ( trailingLetterPlusOne ) ] ;

Left ( invoiceNumber ; 5 ) & subsequentLetter & " is the next invoice in this series." )

I need to get the next-to-last line of this formula to convert the number to a letter. Obviously, GetAsText isn't going to work, and I don't know what will.

Hope this makes sense; Suggestions greatly appreciated. Many thanks--

Posted (edited)

How about:


Let ( [

alpha = "abcdefghijklmnopqrstuvwxyz" ; 

trailingLetter = Right ( invoiceNumber ; 1 ) ;

trailingLetterAsNumber = Position ( alpha ; trailingLetter ; 1 ; 1 ) ;

subsequentLetter = Middle ( alpha ;  Mod ( trailingLetterAsNumber ; 26 ) + 1 ; 1 )

] ;

Left ( invoiceNumber ; 5 ) & subsequentLetter & " is the next invoice in this series." 

)

Edited by Guest
Another typo
Posted

Try this:

Let ( [

trailingLetter = Right ( invoiceNumber ; 1 ) ;

trailingLetterAsNumber = Position ( "abcdefghijklmnopqrstuvwxyz" ; trailingLetter ; 1 ; 1 ) ;

trailingLetterPlusOne = trailingLetterAsNumber + 1 ;

subsequentLetter = Middle ("abcdefghijklmnopqrstuvwxyza"; trailingLetterPlusOne );1 ] ;

Left ( invoiceNumber ; 5 ) & subsequentLetter & " is the next invoice in this series." )

You still need to look after the situation where the current number ends in "Z", but this should get you going.

Posted

Thank you so much for your quick replies and useful suggestions, Comment and BobWeaver. Problem solved! Much appreciated.

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