2 Replies Latest reply on Jul 19, 2013 8:57 AM by ninja

    Prefix Invoices

    PhilWannell

      Title

      Prefix Invoices

      Post


           Good afternoon, I currently have a system where the invoices are prefixed with "gt_" & Invoice Number where invoice number is a serial number generated on creation and incremented by one! Everytime a new invoice is created at the moment the invoice number is increased but its still prefixed with gt_. Unfortunately we need to prefix the invoices with possibly 2 more different codes such as it_ and ty_ however i'm not sure how to implement this into filemaker?

           Is this even possible please?

            

           Kindest regards

            

           Phil

        • 1. Re: Prefix Invoices
          philmodjunk

               I would remove the prefix setting from the auto-entered serial number and remove this data from the field of existing records in your invoice table and also the related records. That prefix encodes some sort of extra "meaning" into your primary key and as you have just found out, this opens the door to future changes to your data in order to update what extra "meaning" is encoded into your invoice number.

               Inplace of this being encoded into your  invoice number, enter this prefix into a separate text field and only use the straight serial number for linking your invoice to other tables in your system. That way, any future changes to this data will not affect how it links to other records via relationships.

               Then you can either add a field that combines the two values for report/display purposes or you can just place the two fields adjacent to each other on your layout as merge fields and they will appear to be a single field.

          • 2. Re: Prefix Invoices
            ninja

                 This is often done by removing the prefix from the autoenter and just autoentering the number to an "InvoiceNumberOnly" field.

                 Then you can Set the Invoice Number field as either a claculation or by SetField in a script and apply the prefix according to your defined criteria.

                  

                 SetField (

                 Case( Country = "Italy" ; "it_" ; Country= "UK" ; "uk_" )

                 & InvoiceNumberOnly

                 )

                  

                 Phil beat me again....