I have the following code on the propertyChange event of a dropdown box and it executes on form load.
I only want it to execute when the selected value changes.
I’m new to Ignition, so any help would be appreciated, Thanks.
if event.propertyName == 'selectedStringValue':
tank = '57'
productNew = event.newValue
productOld = event.oldValue
userName = system.security.getUsername()
user = system.user.getUser("", userName)
userid = user.get(user.FirstName) + " " + user.get(user.LastName)
today = system.date.now()
todayf = system.date.format(today, "yyyy-MM-dd HH:mm:ss")
comp = system.net.getHostName()
system.db.runUpdateQuery("INSERT INTO TankHistory(TankNumber, TankProductOld, TankProductNew, t_Userid, t_stamp, ClientCPU) " + "VALUES ('%s', '%s', '%s', '%s', '%s', '%s')" %(tank, productOld, productNew, userid, todayf, comp))