4 Replies Latest reply on Nov 17, 2013 7:08 AM by philmodjunk

    Different Inoice type ID

    NikosGewrgioy

      Title

      Different Inoice type ID

      Post

           Hello,

           I work on an Invoice template from starter solution.

           I uploaded the file to understand me, what I want to do.

      http://www.dropbox.com/s/xndm5fknaug7wmp/Invoices.fmp12

           Go to Invoice details, you will see two fields, proforma No and Original No.

           When I select from the invoice type the Proforma option I would like to increase the Proforma No by 1 and when I select from the Incoice type the original option I would like to increase the Original No by 1.

           I tried to do but without success.

           Please, could you help me?

           Thank you in advance,

           Nikos

           P.S: sorry for my English!

        • 1. Re: Different Inoice type ID
          NikosGewrgioy

               Please could anyone to help me?

          • 2. Re: Different Inoice type ID
            philmodjunk

                 This is a "selective sum" problem. You want a count of the records in Invoices but only if they meet some additional criteria--a specific value in the invoice type field.

                 I am assuming that the value in "proforma" should be the count of all invoices with an invoice type of Proforma.

                 Here's one way to do that:

                 Define two calculation fields, constProforma and constOriginal. Define constProformat to return text as its result type and put this expression in place as the value it returns:

                 "Proforma".

                 Do the same for constOriginal, but use "Original" as it's expression.

                 In Manage | Database | relationships, make a new table occurrence of Invoices by clicking it and then clicking the duplicate button (2 green plus signs). You can double click the new occurrence box to get a dialog to appear where you can rename the new occurrence box to be Invoices|Proforma.

                 We have not duplicated a table. Instead, this is a new reference to the same table already present in your database.

                 Add it to your relationships like this:

                 Invoices::constProforma = Invoices|Proforma::InvoiceType

                 Repate this process but name the new table occurrence Invoices|Original and use constOriginal as the match field in Invoices.

                 Now you can define a pair of calculaiton fields, cProformaCount and cOriginalCount. Use: Count ( Invoices|Proforma::Invoice Type ) as the expression for the first calculation field and Count ( Invoices|Original::Invoice Type )

                 Put these two calculation fields on your Invoices layout and they will display a count of all Proforma and Original invoices in the table.

                 Please note that I original passed on this post because of information missing from your post. To answer, I had to make a number of guesses about what you want that could be incorrect and thus this suggested solution may not be what you wanted.

                  

            • 3. Re: Different Inoice type ID
              NikosGewrgioy

                   Thank you very much.

                   I made it with different way and it works fine.

                   I made Proforma Number field with auto enter data, then a calculation field "If proforma" with function If ( Type="Pro Forma"; SerialIncrement ( If Proforma; 1) ) and then a Sum field to count the If proforma field.

                   I uploaded the file for check. I don't care for the Incoice ID, only fo the Proforma No and Original No.

              http://www.dropbox.com/s/hh0ir90zxe67ff5/Invoices%203.fmp12

                   Please tell me, from your experience is it reliably?

              • 4. Re: Different Inoice type ID
                philmodjunk
                     

                          I don't care for the Incoice ID

                     You should. While you don't have to make it visible on any layout. It's needed in order for your portal to Invoice Data where you enter items purchased for each invoice, to work.

                     I don't think that your calculation fields will work the way that you think. Your "count of" summary field will work, but the calculations could be simplified to be just:

                     Type="Pro Forma"

                     And you'll get the same results. I think you expect these fields to show a value that increments with each new record of the same type and this will not be the case with what you have set up as the calculations do not access the needed data from the other records of the same invoice type.