5 Replies Latest reply on Aug 27, 2016 10:06 AM by philmodjunk

    How to make invoice portal easy to enter items?


      Below image is what I create for my "Order" table.


      The Item field is related to my inventory table. Currently, I use pop-up menu for the item field and its value is from "Inventory" table's primary ID but display using second field. However, in this case, every time when I need to create an order invoice I need to select the item from the pop-up menu list one by one. Is there a convenient way that I could key-in the item name directly from field but it will still pull related information, such as its price.



      Screenshot 2016-08-21 20.29.36.png

        • 1. Re: How to make invoice portal easy to enter items?

          I do something similar on the pop up (modal in my case), except I added a checkbox field.  The window is sorted by checkbox (descending) then item name ascending.  As you pick the line items they re-sort to the top.

          Then I use a button that gathers the ids in a variable, closes the window.  Then the script goes to the a utility layout for line items, does a find to isolate the new line items, loops thru setting the primary key and foreign keys, returns to original layout.

          You may need either a commit records or refresh portal.


          Products Picker Portal [Add Line Items-Loop]

          The purpose of this script is for the user to select multiple
          products, to add line items to an invoice.


          Global variable of the invoice ID is captured from script
          that opens this layout ($$Inv_PK)


          Allow User Abort [ Off ]

          Set Error Capture [ On ]

          Show Custom Dialog [ Title: "Add Selected Items"; Message:"Would you like to add the selected items to the invoice"; Default Button:“Yes” , Commit: “Yes” ;Button 2: “No”, Commit: “No” ]

          #Buttons: 1=Yes, 2=No

          If[ Get(LastMessageChoice)=1 //Yes-Run script ]

             #First go to list of products utility layout to isolate records checked

               Freeze Window

               Enter Find Mode [ ]

               Go to Layout [ “Products_List” (Products) ]

               Set Field [ Products::Product_checkbox ; 1 ]

               Perform Find [ ]

               # If no records found (no boxes checked), cancel script

               If[ Get(LastError) ]

                    Show Custom Dialog [ Title: "No Products Selected"; Message:"You did not check any products to add to the invoice.";Default Button: “OK”,Commit: “Yes” ]

                    Go to Layout [ original layout ]

                    Exit Script [ ]

               End If

               Go to Record/Request/Page [ First ]


                    #Create new line items. First capture the products primary key

                    Set Variable [ $id_Products ; Value:Products::__pkID ]

                    Go to Layout [ “Line_Items” (Line_Items) ]

                    New Record/Request

                    #Set the foreign key for products with the variable

                    Set Field [ Line_Items::_fkID_Products ; $id_Products ]

                   #Set the foreign key for products with the global variable from invoices.

                    Set Field [ Line_Items::_fkID_Invoice ; $$Inv_PK ]

                    Go to Layout [ “Products_List” (Products) ]

                    Go to Record/Request/Page [ Next; Exit after last ]

                    End Loop

               #Clear the checkboxes

               Replace Field Contents [ Products::Product_checkbox ; Replace with calculation: "" ] [ No dialog ]

               #Clear the global variable

               Set Variable [ $$Inv_PK;""]

               Close Window [ Current Window ]

               Commit Records/Requests [ Skip data entry validation; No dialog ]

          End If

          1 of 1 people found this helpful
          • 2. Re: How to make invoice portal easy to enter items?

            You might be interested in the following file. It contains numerous working examples of Enhanced Value selection techniques that you can use to move beyond simple value lists. Each example comes with detailed documentation on how it works.


            Adventures in FileMaking #2-enhanced value selection

            • 3. Re: How to make invoice portal easy to enter items?

              Hi Phil,


              I followed your example of Auto-Filtering Search Portals. Luckily, I successfully made the items from "Product || All" portal adding to the LineItem Portal in the invoice. However, the gSearch field that I created did nothing at all. I am not sure where I did wrong. Could you please help?


              Screenshot 2016-08-26 14.34.37.png

              I have made that field as a global field "Text Type" in my Order (Invoice) table, and has a script trigger as OnObjectModify "Update Search Portal"


              Below is the relationship chart for your information

              Screenshot 2016-08-26 14.37.08.png

              Is there anything that I overlooked?


              Thank you~

              • 4. Re: How to make invoice portal easy to enter items?

                Hi Phil,


                Never mind. I figured it out. Now, the gSearch field is working perfectly.


                But I have another question! How did you do to make the Product::Product Description on the LineItems portal as a pop-up menu while your control style still remain as Edit box?

                • 5. Re: How to make invoice portal easy to enter items?

                  Well, I didn't do that, but it looks like it.


                  If you scroll down into the "Design Notes" section of this layout, you'll find the following explanation:


                  The description field has been placed on top of the _fkProductID field with Browse mode access denied. The _fkProductID field hidden beneath it has been formatted with the standard two field, field based value list where field 1 supplies the needed ID but is hidden while field two supplies the Description that enables the user to select the correct product by description, but enters the needed ID number. More detail on this method can be found in Adventures In FileMaking #1.

                  Note also that this is not a pop up menu but instead, is a drop down list.

                  And there's a link to AIF #1 in the last layout of AIF #2 if you are interested in checking out that file.