Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3861 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

So I'm not sure where exactly to put this as it deals with a Custom Function, but hopefully this is the right place.  I've been using the excellent #AssignVariables Custom Function over from FilemakerStandards.org for about a year and half with no issues.  Today I tried to implement a script that is taking an enumerated value from a parameter passed on an OnTabSwitch ScriptTrigger and for some reason it is failing, and I have no idea why.

 

The parameter that is being passed is:

"$target=" & Quote ( GetValue ( Get ( TriggerTargetPanel ) ; 2 ) )

The subsequent script then uses the #AssignVariables CF to assign $variable with the contents of the Script Parameter.  The problem is, this is not working.  However, when I run the Data Viewer side by side with the Script Debugger, the Database viewer assigns the parameter correctly!  I have no idea why the Data Viewer would work and the script fails...

Posted

Ok I just went and simplified the Parameter to 'Get ( TriggerTargetPanel )' and the parameter STILL doesn't pass?  Is this a bug?  Let me explain in a little more detail how I'm calling this.

I am controlling a Slide Panel via a Dispatch script and performing checks before allowing a user to progress through a pre-defined process.  If the validation passes, then the user is allowed to navigate to their selection, if the validation fails, then the user is presented with a dialog window. I apologize for the bad syntax as AFAIK there's no way to copy and paste script steps into this forum.

If[#AssignVariables ( Get ( ScriptResult ) )
  If ( $ScriptResult = True )
    Set Script Animation [On]
    Go to Object [Object Name: $destinationSlideControl]
    Refresh Window[]
   Else
     Show Custom Dialog [$failureTitle;$failureText]
     Exit Script[Result: 0]
  End if
End If

The OnTabSwitch SHOULD (IIRC) allow me to pass the name of the tab panel that is specific in the Go to Object Script Step.  The Data Viewer confirms that this is happening and correctly assigns the parameter, but the parameter is definitely not passed (returns a False for isValid).  Am incorrect in how this works?  This honestly feels like a bug...

 

Edit:  So since this is FM13, I thought it might be a bug with the new Slide Controls, I added a tab panel and tried this.  Same results.  This time I tried capturing the name of both the TriggerCurrentPanel AND the TriggerTargetPanel as parameters and got the same result.  The Data Viewer captures the values and passes them correctly wheres as the script returns an empty ScriptParameter.  Am I nuts?

 

Mods: This should probably be moved to the ScriptTrigger sub-forum, as this appears to be more of an issue with ScriptTriggers and not the AssignVariables CF as I first assumed

Posted

a parameter passed on an OnTabSwitch ScriptTrigger

 

1. What is "an OnTabSwitch ScriptTrigger"? Did you mean the "OnPanelSwitch" script trigger?

 

 

2. If a script is triggered by switching a panel, then passing the TriggerTargetPanel to it as a parameter is totally redundant: the script knows what triggered it and it can evaluate the Get ( TriggerTargetPanel ) function directly at any time during the script's runtime.

 

 

3. I can't test this, but I suspect that since a script parameter is evaluated before the script runs, the Get ( TriggerTargetPanel ) function returns empty at that particular point in time. This should be easy to verify by triggering the following script with Get ( TriggerTargetPanel ) being the script parameter:

Show Custom Dialog [ Message: Get ( ScriptParameter ); Buttons: “OK” ]
Show Custom Dialog [ Message: Get ( TriggerTargetPanel ); Buttons: “OK” ]
  • Like 1
Posted

Comment's comments should steer you in the right direction for your immediate problem. On a different note, I notice that you're using the "#AssignVariables" function rather than the "#Assign" function, which tells me you're probably using an older version of the # functions from FileMakerStandards.org. When you get the chance, you should update the functions you're using with what's currently hosted in the FileMakerStandards.org GitHub repository. If you use the # ( name ; value ) function instead of creating the Let Notation yourself, you can be more confident that the syntax of the generated parameter is correct.

Posted

 

1. What is "an OnTabSwitch ScriptTrigger"? Did you mean the "OnPanelSwitch" script trigger?

 

 

2. If a script is triggered by switching a panel, then passing the TriggerTargetPanel to it as a parameter is totally redundant: the script knows what triggered it and it can evaluate the Get ( TriggerTargetPanel ) function directly at any time during the script's runtime.

 

 

3. I can't test this, but I suspect that since a script parameter is evaluated before the script runs, the Get ( TriggerTargetPanel ) function returns empty at that particular point in time. This should be easy to verify by triggering the following script with Get ( TriggerTargetPanel ) being the script parameter:

Show Custom Dialog [ Message: Get ( ScriptParameter ); Buttons: “OK” ]
Show Custom Dialog [ Message: Get ( TriggerTargetPanel ); Buttons: “OK” ]

 

1) Yup, I mistyped, should be OnPanelSwitch

 

2) I guess you're right, I was trying to stay consistent since most of my variables are bound via the #AssignVariables CF at this point it's second nature to pass them as Script Parameters

 

3) You are correct, calling the Get ( TriggerTargetPanel ) function once it's actually in the script returns the correct values.  

 

Thanks!

This topic is 3861 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.