1 Reply Latest reply on Sep 22, 2013 8:06 AM by philmodjunk

    Help on Extending the Estimates Sample project



      Help on Extending the Estimates Sample project



           I'm new to filemaker and trying to create a work related onsite quoting project.  I'm basing my project from the default estimates project within filemaker.  I would like to extend the Estimate Cost portal by automating the input of new portal records based on buttons and checkboxes etc on various tabs within the same layout.
           The desired action i'm looking to implement is when a user clicks a button that is labelled "Remove Wall" and that button is somehow linked to a specific record within the products table.  On clicking this button (or checkbox), that associated product item is then added the Estimate Costs portal.
           My issue is my limited knowledge.  
           My question can be simplified to:
           1) how would i easily link a button or check box or calculated field to a specific "Product" record.
           2) How do you then take the data stored on that product record and populate the "Estimate Costs" portal.
           I hope you are able to help me with this problem.

        • 1. Re: Help on Extending the Estimates Sample project

               I do not have the Estimates Starter Solution open as I make this response. The names I use are thus likely to be different and you'll need to compare what I am suggesting to what you actually have in that file and change names as needed.

               Basic relationships for this are:


               Estimates::__pkEstimateID = LineItems::_fkEstimateID
               Products::__pkProductID = LineItems::_fkProductID

               This script will take a Product ID passed to it as a script parameter and use it to create a new record in LineItems that is linked to the curreent Esimates records so that it automatically appears in your portal to LineItems when you click that button.

               Freeze Window
               Set Variable [$EstID ; value: Estimates::__pkEstimateID ]
               Go to Layout ["LineItems" ( LineItems ) ]
               New Record/Request
               Set Field [LineItems::_fkProductID ; Get ( ScriptParameter ) ]
               Set Field [LineITems::_fkEstimateID ; $EstID ]
               Go to Layout [Original Layout]

               In button setup, when you set up the button to perform the above script, you'll find a box labeled "Optional script parameter". Put the product ID of the desired product in that box in order for the above script to work.

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained