I have a script which works fine in the script console but is failing when I run it as a tag script. The point of failure is definitely in the way the script is looking at the SQL query return - by injecting flags into the script I can tell it is choking on the row “for row in range(query.getRowCount()):”. Playing with this I can see that ANY calls to pull data from the returned query are not working.
Again, I am able to run this script just fine from the script console so this is really a mystery to me. Can anyone please comment on this? Thanks!
email=‘Here is the list of problem shelf items for today:’ + ‘\r\n’ + ‘\r\n’
query = system.db.runNamedQuery(“Today’s Problem Shelf Items”)
email += str(query)+ ‘\r\n’
for row in range(query.getRowCount()): <—Here is where script is stopping!
for col in range(query.getColumnCount()):
email+=str( query.getValueAt(row, col) )
recipients = [“email@example.com”]
system.net.sendEmail(“exsmtp.na.xxxx.cnb”, “AlarmNotification@xxxx.com”, “Multi-Line Email”, email, 0, recipients)