EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Posted: 2020-04-16 05:29 PM . Last Modified: 2023-05-03 12:15 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-04-16 05:29 PM . Last Modified: 2023-05-03 12:15 AM
I am trying to get the Record ID of rows (Data Table that is queried into a list) into a script through a pick action. I need to edit certain values in the rows using a form and needed the selected row's Record ID into the function as an argument? Or is there any other way to do this?
Cheers!
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-04-17 12:01 AM . Last Modified: 2020-04-17 12:44 AM
The property CurrentRowIdx will indicate what row was clicked (in the order of all rows queried). As the row index depends on the sorting etc, this can be problematic, as you would need your script to requery the list and work out which row was selected. However, we made this easier in 2019 - see clip from release notes here:
Using Scripts with SQL Queries on Mimics
We have extended the scripted properties available on lists within mimics. These enable the data values in the first column of the list to be read after the click. Properties are Current1stColDataStr for a string column and Current1stColDataInt for integer data. Previously it would have been necessary to read the row number of the clicked list, then re-run the query from script to check which row data was selected. These new properties allow script to be more efficient. For example, add a query to a mimic with the SQL SELECT DESCRIPTION FROM CSEVERITY. Then add a script pick action which includes:
MsgBox "You clicked row " & _
Mimic.Layers("New Layer").Item("Lst_1").CurrentRowIdx & _
" Text " & _
Mimic.Layers("New Layer").Item("Lst_1").Current1stColDataStr
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-04-16 08:18 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-04-16 08:18 PM
I don't have a huge amount of experience with data tables so I could be wrong, but to my knowledge data tables don't have a Record ID column unless you add one yourself. So unless you have some other unique field I guess adding a RecordID column would be the solution.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-04-17 12:01 AM . Last Modified: 2020-04-17 12:44 AM
The property CurrentRowIdx will indicate what row was clicked (in the order of all rows queried). As the row index depends on the sorting etc, this can be problematic, as you would need your script to requery the list and work out which row was selected. However, we made this easier in 2019 - see clip from release notes here:
Using Scripts with SQL Queries on Mimics
We have extended the scripted properties available on lists within mimics. These enable the data values in the first column of the list to be read after the click. Properties are Current1stColDataStr for a string column and Current1stColDataInt for integer data. Previously it would have been necessary to read the row number of the clicked list, then re-run the query from script to check which row data was selected. These new properties allow script to be more efficient. For example, add a query to a mimic with the SQL SELECT DESCRIPTION FROM CSEVERITY. Then add a script pick action which includes:
MsgBox "You clicked row " & _
Mimic.Layers("New Layer").Item("Lst_1").CurrentRowIdx & _
" Text " & _
Mimic.Layers("New Layer").Item("Lst_1").Current1stColDataStr
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.