Unable to Run Script on Button Click

Kindly Help me in solving this. Always getting this error when I simply runs a script on a button click, for getting a value from a text field and writing it to a memory tag.


Error Getting

Actually, I want a run a script for getting data from Alarm Journal Table and exporting it to Excel.
For this I use this script, but unfortunately I am getting the same error.

Actual Script To be Run:

Perspective events do not work in the same way that vision scripts do.

Use the property selector to select the desired properties

Thank You So Much Irose for responding.

Can you please guide me a little more, from where I could run this script in perspective.

You can’t run either of these scripts as they are in perspective. They are written with respect to Vision.

Specifically the event.source.* is invalid outside of vision.

Also perspective components do not have a .getComponent() method.

Use the property selector in the top right side of the event script editor to select the component property that you want.

1 Like

You are running the script in the right place, the script is just wrong.

The error message states that the ‘event’ object doesn’t have a ‘source’ attribute.

Using self.view will reference the view the button is located in, from there you can point it to the alarm journal table.
e.g. e.g. if the alarm journal table is a child object of the view and it’s name is AlarmJournalTable use: self.view.AlarmJournalTable