SuppressTriggersStart ( )

Function stats

Average user rating
260
290
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

SuppressTriggersStart  (  )


Parameters

No parameters for this function.


Description

Tags:  Script Triggers  

TriggersDisable sets global variables to indicate that the current script is suppressing triggers. This script must be called from the context f a script; otherwise, it will not suppress triggers, and it will return False. 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

TriggersDisable


Sample output

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

 

Function code

/**
* =====================================
* TriggersDisable
*
* PURPOSE:
* TriggersDisable sets global variables to indicate that the current script is
* suppressing triggers. This script must be called from the context of a
* script; otherwise, it will not suppress triggers, and it will return False.
* 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 called from the context of a script, and therefore triggers have
* been suppressed; 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 TriggersEnable
* 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 ( [
    ~scriptName = Get ( ScriptName );
    ~scriptIsRunning = not IsEmpty ( ~scriptName );
    $$~DISABLETRIGGERS.SCRIPTS =
        If ( ~scriptIsRunning;
            ~scriptName & "¶" & $$~DISABLETRIGGERS.SCRIPTS;
            /*else*/ $$~DISABLETRIGGERS.SCRIPTS
        );
    $$~DISABLETRIGGERS =
        If ( ~scriptIsRunning;
            True;
            /*else*/ $$~DISABLETRIGGERS
        )
];
    ~scriptIsRunning
)

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

    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/290

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

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

 

 

 

 

 

 

 

Top Tags

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