SuppressTriggersStop ( )

Function stats

Average user rating
260
291
9999
Support
FileMaker 10.0 +
Date posted
13 December 2010
Last updated
14 December 2010
Version
Recursive function
No

Author Info
 Jeremy Bante

10 functions

Average Rating 5.0

author_avatar



 

Function overview

Prototype

SuppressTriggersStop  (  )


Parameters

No parameters for this function.


Description

Tags:  Script Triggers  

TriggersEnable sets global variables to indicate that the current script is no longer suppressing triggers. This function will also turn off trigger suppression altogether if there are no other scripts suppressing triggers. In order to be suppressed, a script called via trigger should use the TriggersAreActive function to decide whether or not to run.

Unfortunately, this Web site does not allow contributors to re-name or delete a contributed function. Thus the discrepancy between the page name and all references to the function on the rest of the page.

Examples

Sample input

TriggersEnable


Sample output

1 //True, meaning that the current script is no longer suppressing triggers

 

Function code

/**
* =====================================
* TriggersEnable
*
* PURPOSE:
* TriggersEnable sets global variables to indicate that the current script is
* no longer suppressing triggers. This function will also turn off trigger
* suppression altogether if there are no other scripts suppressing triggers. In
* order to be suppressed, a script called via trigger should use the
* TriggersAreActive function to decide whether or not to run.
*
* RETURNS:
* True (1) if TriggersEnable successfully removed the current script from
* the list of scripts suppressing triggers; False (0) otherwise.
*
* PARAMETERS: none
*
* REFERENCED VARIABLES:
* $$~DISABLETRIGGERS
* $$~DISABLETRIGGERS.SCRIPTS
*
* DEPENDENCIES: none
*
* EXAMPLE (script):
* Set Variable [ $ignoreMe ; TriggersDisable ]
*    # Do something
* Set Variable [ $ignoreMe ; TriggersEnable ]
*
* NOTES:
* This function should *always* be used in pairs with the TriggersDisable
* function.
*
* HISTORY:
* MODIFIED on 2010-12-13 by Jeremy Bante of The Support Group to use names suggested at
* filemakerstandards.org.
* CREATED on 2010-12-12 by Jeremy Bante of The Support Group.
*
* REFERENCES:
* The TriggersAreActive function: http://www.fmfunctions.com/fid/289
* The TriggersDisable function: http://www.fmfunctions.com/fid/290
* The TriggersEnable function: http://www.fmfunctions.com/fid/291
* The TriggersReset function: http://www.fmfunctions.com/fid/292
* =====================================
*/

Let ( [
    ~lastScript = GetValue ( $$~DISABLETRIGGERS.SCRIPTS ; 1 );
    ~enableTriggers = Get ( ScriptName ) = ~lastScript; //boolean indicating script name match
    $$~DISABLETRIGGERS.SCRIPTS =
        If ( ~enableTriggers;
            RightValues ( $$~DISABLETRIGGERS.SCRIPTS ; ValueCount ( $$~DISABLETRIGGERS.SCRIPTS ) - 1 );
            /*else*/ $$~DISABLETRIGGERS.SCRIPTS
        );
    ~scriptCount = ValueCount ( $$~DISABLETRIGGERS.SCRIPTS );
    $$~DISABLETRIGGERS = If ( ~scriptCount ; True ; /*else*/ "" )
];
    ~enableTriggers or not ~scriptCount //ScriptName was found and removed, or there are no suppressing scripts
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/291

    Prototype: SuppressTriggersStop( )
    Function Author: Jeremy Bante (http://www.fmfunctions.com/mid/260)
    Last updated: 14 December 2010
    Version: 1.2

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (31)
List  (27)
Date  (26)
Format  (23)
XML  (22)
Sql  (18)
Dev  (18)
Debug  (15)
Interface  (13)
Text  (13)
Layout  (13)
Variables  (12)
Filter  (11)
Design  (10)
Layout Objects  (8)
Array  (7)