3 Replies Latest reply on Oct 15, 2010 7:16 PM by HowardRathbun

    How can I capture the data from a portal row that is selected by the cursor?

    HowardRathbun

      Title

      How can I capture the data from a portal row that is selected by the cursor?

      Post

      I would like to capture the contents of a field in a  multi-row portal by clicking the desired row and field with the mouse.  I will then use the field data in a script.  There is no way to know in advance which row will be selected.   I tried connecting a script to the appropiate field in edit mode but that only displays one row in the portal.  There must be a way to do this.  Thanks in advance.

        • 1. Re: How can I capture the data from a portal row that is selected by the cursor?
          philmodjunk

          If you put a button in the portal row or set up a field or group of fields as a button, the mouse click that triggers the button also selects that portal row and makes it the active portal row.

          Any references to the fields in the portal made by the script will then refer to the selected portal row's record as long as now script action takes the focus away from this active portal row.

          Thus, many such scripts start with a series of set variable steps that copy selected fields from this portal row record (any field in this related record--even if not placed on this portal's row), that are needed to different variables. You can also save the current portal row number in a variable if you need to keep track of it using get ( activePortalRownumber ).

          • 2. Re: How can I capture the data from a portal row that is selected by the cursor?
            LaRetta_1

            You can capture the value of any field with script trigger OnObjectEnter attached to field.

            Script step with simple Set Variable [ $value ; Get ( ActiveFieldContents ) ] or any variation.  Script can use Get ( ScriptParameter ) also, with this function attached as parameter.

            Note you cannot grab field value using OnObjectEnter when clicking or popping pop-up menu, radio button or checkbox although tabbing to these objects will properly select original value.

            • 3. Re: How can I capture the data from a portal row that is selected by the cursor?
              HowardRathbun

              I solved the problem as suggested by Laretta.  In edit mode I set a script trigger in the TargetField (it will always be the same field).  The script is as follows:

              gotofield [TargetField]

              if position(TargetField; "special text" : 1 ; 1) > 0

                  do stuff

              endif

              It works perfectly,  Clicking on any other field in the row with special text or in any row without the special text, does nothing.