1 Reply Latest reply on Feb 19, 2014 4:28 AM by Jade

    Scripting Get (Active...) Functions



      Scripting Get (Active...) Functions


           I am having considerable frustration with scripting Get(Active...) functions using FM12 Pro: I have a single layout with one text field that activates as a button and performs the following simple script:

      •           Set Variable [$T1; Value:Get(ActiveFieldName)]
      •           Set Variable [$T2; Value:Get(ActiveFieldContents)]
      •           Set Variable [$T3; Value:Get(ActiveFieldTableName)]
      •           Set Variable [$T4; Value:Get(ActiveLayoutObjectName)]

           I turn on Script Debugger and Data Viewer: Then I mouse the text field and step through the script, the Data Viewer shows no values returned by any of the four Get() functions no matter what is entered in the text box. Could someone please tell me what I am doing wrong? Is this similar to the functions that do not work if you have a "." in the file name or the GetField () will not work with any calculation using Get(LayoutName) – must be Get(LayoutTableName)?


           Thanks, Knucklehead

        • 1. Re: Scripting Get (Active...) Functions

               I suspect that your script is executed while the Button has focus and not the intended Field unless you have a Go to Object (or Field) script step in front of the Set Variable[…] steps.  Try setting a field script trigger (e.g. OnObjectEnter or OnObjectExit) instead of the button.