I have a script triggered by a property change event on a calendar object. When I select a date on the calendar the script will run multiple times, with different results. I am using this to set up a database selection in another object and need to ensure the script only runs one time to set up the parameters.
I have also tried attaching the script to the mouse click event but that did not seem to run at all.
Here is the script I am running:
[code]from java.util import Calendar
cal = Calendar.getInstance()
cal.add(Calendar.HOUR, -24)
olddate = cal.getTime()
calen = event.source.parent.getComponent(“Calendar”)
date = calen.date
if date < olddate:
print “Archive”
event.source.parent.getComponent(‘PassData’).Database = ‘L_PROC_DATA’
event.source.parent.getComponent(‘PassData’).TableName = ‘COIL_PROC_SUMMARY’
else:
print “Active”
event.source.parent.getComponent(‘PassData’).Database = ‘Tmill’
event.source.parent.getComponent(‘PassData’).TableName = ‘RTM_COIL_HSIO_SUM’[/code]
Any help would be greatly appreciated.
Pat Russell