1 Reply Latest reply on Mar 25, 2010 1:01 PM by ninja

    Portal record field not displayed, how do I add to calculation

    Capt-Tuttle

      Title

      Portal record field not displayed, how do I add to calculation

      Post

      Hello

       

      Windows NT

      FileMaker Pro 10

      Beginner

       

      I am trying out a couple of different table formats to create a table or tables that record our test data

       

      Currently I am trying a format where the test data results are stored in 1 table and all our test procedures and expected results are stored in another.

       

      Table #1           DUT    “Device Under Test”

                  Part number

                  Serial Number

                  Test Procedure

                  TD1                

                  TD2

                  TD3

                  …….

                  TD100

       

      Table #2           TestProcedures

                  Test Procedure

                  Test Step

                  Instructions

                  Expected Results          “Text Comments”

                  MinValue

                  MaxValue

                  TextValue

       

      The two tables are related by Test Procedure

       

      On a layout, using the DUT table, I have two portals from the TestProcedures table interspaced with fields from the current open record.

      Example:

       

      Portal1----------------------------                              Portal 2-------------

      ::Test Step        ::Instructions     :TD4                ::Expected Results         :TD5

                                                              :TD6                                                           :TD7

                                                              :TD8                                                           :TD9

       

       

      So the portal is set up to display test steps, in order, from only the related test procedure

       

       

      Example

      1.1       Test 5 Volt       TD4     5Vdc +/- 0.5V             TD5

      1.2       Test 10 Volt     TD6     10Vdc +/- 0.5V           TD7

      1.3       Test 15 Volt     TD8     15Vdc +/- 0.5V           TD9

       

      So Far so good:

      What I want to do next with a script & calculation is set the Pass or Fail status in a field based on the data entry. Example the user enters the number 5 into TD4. I would like to compare it to the MinValue and MaxValue for that test procedure record and set TD5 to PASS or FAIL. What I am not sure how to do is access the MinValue and MaxValue from the portal record when it is not displayed.

       

      Thanks

       

      Added 3-23-10

       

      Probably not the right way to do it but it works for now

      I modified the 2nd Portal to include the MinValue and MaxValue fields.

      In the layout I reduced their width to minium and hid them in my layout

      Now when the user enters data in a TDx field and activates the script :

      Get table name

      Get active field name

      get active field value

      go to next field " Expected Results

      go to next field "MinValue"

      Get active field value

      go to next field "MaxValue"

      Get active field value

       

      some caculations and my results look like

       

      1.1       Test 5 Volt       5.4     5Vdc +/- 0.5V             PASS

      1.2       Test 10 Volt     10.6  10Vdc +/- 0.5V           FAIL

       

      Would still like to know what a better way is if anyone would like to comment.

        • 1. Re: Portal record field not displayed, how do I add to calculation
          ninja

          howdy Capt,

           

          The recommendation i would give is to eschew the script approach altogether, use a calc field instead.

           


          Capt-Tuttle wrote:

          I modified the 2nd Portal to include the MinValue and MaxValue fields.

          In the layout I reduced their width to minium and hid them in my layout


          You don't need the field on the layout in order to use it.  Simply leave it off of the layout if you don't want to see it.

           

          I would set my Pass/Fail field to a calc field resulting in text:

           

          If (TDx > MinValue AND TDx < MaxValue ; "Pass" ; "Fail" )

           

          now your user doesn't have to launch the script in order to get the test results.