Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

UNNotification.SetActionScript

Sets which script to call when a notification’s action is triggered.

Component Version macOS Windows Linux Server iOS SDK
UNNotification 7.2 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "UNNotification.SetActionScript"; FileName; ScriptName )   More

Parameters

Parameter Description Example
FileName The database file name where the script is located. "test.fmp12"
ScriptName The script name. "MyScript"

Result

Returns OK or error.

Description

Sets which script to call when a notification’s action is triggered.
Called for both local and remote notifications.

Parameter to the script is a list with first the ID of the notification and second the action identifier. The notification is a new object (copy), so you get a new identifier. Use UNNotification.AddUserInfo if you need to pass on data with the notification like a record ID.

Use UNNotification.AddUserInfo to associate your own values with the notifications, which you can then use in the triggered script.

Examples

Sets action script:

MBS( "UNNotification.SetActionScript"; Get(Filename); "NotificationActionTriggered" )

See also

Example Databases

This function is free to use.

Created 15th April 2017, last changed 15th December 2025


UNNotification.Schedule - UNNotification.SetBadge