3 Replies Latest reply on May 20, 2014 9:23 AM by flybynight

    Regarding Auto Increment


      Dear Sir,


      Yet i have customise the Estimate detail layout according to my useable fields. I want to put auto increment of no. in S.No. column for each new record which i have add in estimate layout. I have tried to put value from auto serial No.but the value are comming in contigenius serial way. Means if i go for next record then the no are displaying next to from last no of previous record. I hope i may some were wrong on putting the correct value list.



        • 1. Re: Regarding Auto Increment

          If I am understanding you correctly, you want your EstimateLineItems to be numbered 1, 2, 3, 4, etc.

          I assume that these are child records, related to a parent Estimate table.


          I have a similar solution involving JobTickets with child JobItems, and we want each item to be numbered. A serial number won't work, because that will give you the next number for ALL EstLineItems, not the next one under this parent Estimate record.


          What I do, is I have a script called "Reset Job Part #s" - and I call this as a subscript at the end of any script that creates, deletes, duplicates, etc. a child record. Here are the basics of what the script does (I changed the table names to match a guess of your tables):


          Commit Records (I had some issues with the script if it ran before a record was commited, YMMV)

          Go to Related Records [Show only related records; From table: "EstLineItems"; Using layout: "EstLineItems"; New Window]

          Sort Records [Restore; No dialog] 

               For our business logic, we always order them by creation date, so that is my sort order.

          Go to Record [First]

          Replace Field Contents [No dialog; EstLineItems::S.No.; Serial numbers]

               In this case, it will do serial numbers for only these records - I have it set to start at 1, increment by 1.

          Close Window [Current Window]


          This works for me… you may have to tweak things for your needs. Others may have different/better ways. There are always more than 1 way to accomplish a task in FileMaker!




          • 2. Re: Regarding Auto Increment

            Thanks Sir for your reply


              Though i am not so much familiar with script values. So i request you to give me the appropiate script values which will be suitable or applicable for the for getting me increment no in S.No. Column.If possible pls send video tut.

            • 3. Re: Regarding Auto Increment

              I think I spelled things out rather plainly.

              If you are not familiar with building basic script steps, then perhaps this is not the forum for you right now. We are all glad to help here when you run into troubles, but there is an assumption that everyone here knows the basics of developing in FileMaker Pro. This isn't the place to get training.


              To get you started, I highly recommend the FileMaker Training Series (FTS). They have a free Basics eBook that will teach you everything you need to get started. Beyond that, there is the Advanced eBook for $20 - a great deal. You can also check out the training videos on Lynda.com. There are also tons of YouTube videos, though they may not be as structured to give you a good foundation. If you really want to dive in, find a FileMaker certified trainer in your area.