Function: ACF_run

The ACF_run function allows you to execute any of your ACF functions. Once your functions are compiled or loaded, you are ready to execute them. In your code, other ACF functions can be called directly using their names; there's no need to use ACF_run from inside an ACF function to execute another one. ACF functions can call each other directly. However, if you want to call a function in a different package, you can use the ACF_run syntax enclosed in "@" signs to achieve this. In a future release of the plugin, this feature may be available directly.

The ACF_GetAllPrototypes function returns a text containing all your loaded ACF functions, along with their parameters and types, as they can be called from a FileMaker Script Step, Calculation, or directly from a button.

It's important to ensure that the number of parameters matches when calling ACF functions. If you add parameters to an ACF function, you must also update any places where you call that function from FileMaker to match the new parameter count. This behavior is consistent with regular custom functions in FileMaker.

Functions can have arrays as parameters, which work smoothly when ACF functions call each other. However, since FileMaker does not have an array data type, you cannot supply such an argument from FileMaker using the ACF_run command. In the future, there are plans to introduce a feature that allows a variable number of parameters, where the last argument to a function can be declared as an array to collect additional parameters as array cells. Currently, this feature is not available.

Prototype:

ACF_run ( <Function name>; <List of parameters according to the function declaration, separated by semicolons>)

Parameters:

Parameter name  Type  Description
Function name  string  The name of the function. You can use ACF_GetAllPrototypes to copy and paste functions directly.
Parameters  As declared  Parameters according to the declaration. The number of parameters must match. There are no default values for parameters.

Return value:

The return type and value depend on the return value and type specified in your ACF function.

Example:

// For an ACF function declared like this: 

Function CreateCID ( int InvoiceNumber, int CustomerNumber, int CIDlength)
...
...
END

// And from a FileMaker script step: 

Set Field ( Invoices::CID number; ACF_run  ("CreateCID"; Invoices::Invoice_number; Invoices::CustomerNumber, 16))

References: