Skip to content

pacx forms removehandler

github-actions[bot] edited this page Aug 22, 2026 · 1 revision

Removes a javascript event handler from the main form of a given table

Aliases

pacx form removehandler

Usage

Counterpart of 'forms addhandler'. Removes a handler registration from the form definition, the same way deleting it in the form designer would.

Remove an OnLoad handler from the main form of a table:

pacx forms removehandler --table account --library myprefix_scripts.js --function My.Account.onLoad

Remove an OnChange handler from a specific column:

pacx forms removehandler -t account -l myprefix_scripts.js -fn My.Account.onNameChange -e OnChange --field name

When the removed handler was the last one referencing the webresource library, the library is removed from the form as well. Event entries that remain empty are cleaned up, so the form definition ends up the same way the designer would leave it. If the handler is not registered, the command makes no change, so it is safe to run repeatedly.

The command does not check whether the webresource still exists in the environment, so it can also be used to clean up registrations of webresources that have already been deleted.

Use --output to save a backup of the original form before any change is applied. By default the form is updated through a temporary solution, use --fast to update the formxml directly instead, which takes seconds instead of minutes:

pacx forms removehandler -t account -l myprefix_scripts.js -fn My.Account.onLoad --fast --output C:\temp

Please note: unless --fast is used, the command needs to create a temporary solution in the target environment. The temporary solution is deleted automatically once the operation is complete.

Arguments

Long Name Short Name Required? Description Default value Valid values
table t Y The name of the table to which the form belongs - String
library l Y The name of the javascript webresource that contains the handler function (e.g. myprefix_/scripts/account.js) - String
function fn Y The name of the function to remove, including its namespace (e.g. My.Account.onLoad) - String
event e N The form event to remove the handler from. OnLoad OnLoad, OnSave, OnChange
field col N The logical name of the watched column. Required for (and only valid with) the OnChange event. - String
form f N The name of the form to update. It is required only if the table has more than one Main form. - String
solution s N The name of the solution that contains the table. If not provided, the default solution will be used - String
output out N If specified, the command will export the original version of the form in the specified folder before applying any change. The folder must exist. - String
fast ft N Updates the formxml of the form directly instead of going through a temporary solution. Much faster; the platform still validates the formxml on update, but the all-or-nothing safety of a solution import is skipped. False true, false

Command list

Clone this wiki locally