John, Here's a custom function that may do what you need: http://www.briandunning.com/cf/718
It's designed to increment letters onto the end of modified POs - 1011, 1011A, 1011B, etc You can used a self join to get your existing group, find the last letter, then increment it to the next letter. -- Steve Gerow FileMaker 9/8/7 Certified Developer President Abrazos Data Consulting, Inc. Pasadena, California 626.398.1506 Member FileMaker Bus. Alliance > -------Original Message------- > From: John Wenmeekers <[email protected]> > Subject: Re: Record with following suffix > Sent: Nov 29 '09 13:52 > > >I may not be understanding the full scope of the problem, but it > >seems to me that you've already laid out the essence of the solution: > >3 component fields, with a calculation field to generate the ID: > > > >ID = > > Prefix & > > If ( IsEmpty ( Prefix ), "", "-" ) & > > SerialNumber & > > If ( IsEmpty ( Suffix ), "", "-" ) & > > Suffix > > > > > > > Sorry Richard. In my 'anger' about another useless change dictated from > 'above' I forgot to mention the essential part. > > I have to create new records (documents) with a script. > > This is no problem for the first two parts : prefix and number. > > The problem is to tell FileMaker which suffix to use if needed. > > If I have a document with prefix 'VUE', with a self-join relationship I can > find the next number (Max( relation::field) +1, it doesn't need a suffix. > > The document with 'AFA' (among others) as prefix needs a suffix A....Z. > > So the range would be: > > AFA-01-A > AFA-01-B > ... > AFA-01-F > > or > > AFA-02-A > AFA-02-B > AFA-02-C > ... > > A new record in the AFA range will depend on the number + suffix. > In the AFA-01 range, it should be AFA-01-E, > and in the AFA-02 range it should be AFA-02-D. > > My problem is to find a way so FM can recognize the situation and add the > right suffix.... > > On top of that, I'm afraid that sooner or later a new 'chief of department' > will come up with his own preferred method to 'mark' his presence. > But that will be something to deal with later. > > I hope this is clear now.... > > In Kindness > > JW >
