I have an Equipment schedule with several rows and I have certain logic that applies depending on what row an event is dropped onto. Sometimes when the event is dropped, it will create more than one instance of itself and lock-up. By lock-up, I mean the event schedule will no longer respond. I will have to re-open the page to get it running again.
There is no error generated so I can’t use error handling to address this. Is there something wrong with my code (example below). The other rows have more complicated logic. What can I do to prevent this from happening or fixing it when it does happen?
The only common theme I have noticed is that it tends to happens when an object is rapidly moved multiple times in a row.
Here is an example of one of the logical statements in my script:
Data=self.scheduledEvents if oldItemId==0 and newItemId==0: for i in range(Data.getRowCount()): if Data.getValueAt(i,'EventID')==eventId: Data=system.dataset.setValue(Data,i,'ItemID',newItemId) Data=system.dataset.setValue(Data,i,'StartDate',newStartDate) Data=system.dataset.setValue(Data,i,'EndDate',newEndDate) break self.scheduledEvents=Data