Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The condition script enables you to define whether an action should be available for the user, visible but disabled, or hidden from the user entirely.

By default, when you add a new action, it will have the following default condition script.

Code Block
number ENABLED = 1;
number DISABLED = 2;
number HIDDEN = 3;

return ENABLED;

The script returns one of the predefined variables: ENABLED, DISABLE or HIDDEN.

  • Enabled actions are available for the user to execute.

  • Disabled actions show the button for the action but it will be disabled, preventing the user from executing the action.

  • Hidden actions will hide a button on the UI and thus such action will also be unavailable for the user to execute.

Of course, because we are using SIL, the return value of the script can be conditional.

Code Block
number ENABLED = 1;
number DISABLED = 2;
number HIDDEN = 3;

if(<some_condition>){
	return ENABLED;
}
if(<some_other_condition>){
	return DISABLED;
}
return HIDDEN;

See More

Child pages (Children Display)
pageConfiguring a Power Actions Custom Field