Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Button

  • Last UpdatedJun 25, 2024
  • 2 minute read

Use scripts to set and get values for the properties of the Button control.

Basic

Property

Scripting Supported

Example

Name

Yes

Writable

Readable

To set the property

control.findById("ID").tagName = "Value for Name";

To get the value of the property

control.findById("ID").tagName;

XML Node

Yes

Readable

To get the value of the property

control.findById("ID").xmlNodeBoundTo;

Description

Yes

Writable

Readable

To set the property

control.findById("ID").description = "Value for Description";

To get the value of the property

control.findById("ID").description;

Tooltip

No

Not Applicable

Button Text

Yes

Writable

Readable

To set the property

control.findById("ID").buttonText = "Value for Button Text";

To get the value of the property

control.findById("ID").buttonText;

Button Type

No

Not Applicable

Appearance

Property

Scripting Supported

Script

Enable

Yes

Writable

Readable

To set the property

control.findById("ID").enable = true;

To get the value of the property

control.findById("ID").enable;

Visible

Yes

Writable

Readable

To set the property

control.findById("ID").visible = true;

To get the value of the property

control.findById("ID").visible;

Label Position

No

Not Applicable

Label-Control Area

No

Not Applicable

Alignment

No

Not Applicable

Retain Space

No

Not Applicable

Display Mode

No

Not Applicable

Button Size

No

Not Applicable

Image Path

No

Not Applicable

Image Position

No

Not Applicable

Show as Link

No

Not Applicable

Custom Style Sheet Identifier

No

Not Applicable

Validation

Property

Scripting Supported

Example

Show Confirmation Message

No

Not Applicable

Confirmation Message Text

No

Not Applicable

Advanced

Property

Scripting Supported

Example

On Click

Yes

For more information, see scripting guidelines for On Click property.

ID

No

Not Applicable

Form Button

No

Not Applicable

Scripts

Property

Scripting Supported

Example

Name

Yes

return "Value for Name";

Description

Yes

return "Value for Description";

Enable

Yes

return true;

For more information, see scripting guidelines for Enable property.

Visible

Yes

return true;

For more information, see scripting guidelines for Visible property.

Note:
You can identify the last button clicked on a form through script as follows:

control.topLevelForm.lastButtonClickedText === "Name of the Button Text";

OR

control.topLevelForm.lastButtonClickedId === "Name of the Button ID";

This script is helpful when the control is used with the Possible Distinct Outputs property for Invoke Workflow activity of the workflow.

For example, if you want to enforce a user to enter comments when rejecting a form, then the following script can be coded for the Mandatory property of the Text control.

return (control.topLevelForm.lastButtonClickedText === "Reject")?true:false;

OR

return (control.topLevelForm.lastButtonClickedId === "B2")?true:false;

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in