Skip to main content

Enable/Disable Troi File Plug-in (script step reference)

By June 1, 2024June 4th, 2024Online Help, Troi File Plug-in
Troi File Plug-in > Script steps reference > Enable/Disable Troi File Plug-in
Troi File Plug-in for FileMaker Pro

Enable/Disable Troi File Plug-in

Controls the functions of the plug-in. You can disable and enable the functions of the plug-in. This allows you to create powerful solutions, without the risk of users misusing the functions, causing unwanted or harmful results.

SyntaxScript step badge

Enable/Disable Troi File Plug-in [ Select ; Result (error) ; Action ;
                                   Password ]

Options

Select entire contents replaces the contents of a field with the result. If not checked the result replaces the currently selected portion of the field
Result (error) an error code
Action select "Disable": allow no access to the plug-ins functionality, or select "Enable": to enable access to all functionality
Password the password to be used

Returned Result

Data type returned

Error code

Result

The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:

0 no error
$$-4217 pwdAlreadySet password already set (enable first)
$$-4218 alreadyEnabled functions are already enabled
$$-4219 pwdWrong password was wrong

Other errors may be returned.

Originated in

Troi File Plug-in 9.0

Compatibility

FileMaker Pro 17 to FileMaker Pro 21 (2024)

Considerations

When you call a disabled function an error code of $$-4220 is returned.
After restart of FileMaker all the functions of the plug-in are re-enabled.

Example

Enable/Disable Troi File Plug-in [ Select ; $ErrorCode ;  Disable ; "secret password" ]

This will disable the functions of the plug-in.

Example 2

We assume that in your FileMaker file the following fields are defined:

    gErrorCode		Global, number	
    gPassword		Global, text

gPassword should contain a password, for example “rapunsel”. Add the following to the startup script:

Enable/Disable Troi File Plug-in [ Select ; gErrorCode ;  Disable ; gPassword ]

This will disable the plug-in functions. When you want to use the plug-in add the following script steps:

Enable/Disable Troi File Plug-in [ Select ; gErrorCode ; Enable ; gPassword ]
# 
# ... add your powerful functions here...
# 
Enable/Disable Troi File Plug-in [ Select ; $ErrorCode ; Disable ; gPassword ]

This will temporarily enable the plug-in functions.

Related functionFunction badge

TrFile_Control

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 16 to 2024 –> Enable/Disable Troi File Plug-in (filep7203) 2024-0604 18:58:05