| View previous topic :: View next topic |
| Author |
Message |
Die-Planer
Joined: 13 Oct 2008 Posts: 15
|
Posted: Thu Oct 01, 2009 12:04 pm Post subject: udfs looses value after a exeption is thrown by a script |
|
|
Hello,
we have some trouble with our user definded fields.
When someone creates a message we're checking the data with scripts. For example
| Code: | if (message.getHrs().doubleValue() < 0.0001)
throw new Exception("'Actual Time' muss einen Eintrag haben!");
return message; |
The type of script in this case is "Trigger / Add Message / BEFORE Trigger".
Now, when a execption is thown, we have the problem that we lost all data in our udf. That means, for example, that the text in a memo field is empty, or a value, choosen i a list, is reset to "choose" after getting the exception.
When the user now fill in the actual time a saves the message again we loose the data in our udfs.
Do you have an idea what is our mistake? |
|
| Back to top |
|
 |
admin Site Admin

Joined: 01 Jan 1970 Posts: 6122 Location: Smolensk, Russia
|
Posted: Thu Oct 01, 2009 12:53 pm Post subject: Re: udfs looses value after a exeption is thrown by a script |
|
|
Which TrackStudio version do you use now ? _________________ Maxim Kramarenko (mailto: maximkr@trackstudio.com)
TrackStudio - Hierarchical Bug & Issue Tracking Software
http://www.trackstudio.com |
|
| Back to top |
|
 |
Die-Planer
Joined: 13 Oct 2008 Posts: 15
|
Posted: Fri Oct 09, 2009 3:50 pm Post subject: |
|
|
| We're using TrackStudio v3.5.49 |
|
| Back to top |
|
 |
admin Site Admin

Joined: 01 Jan 1970 Posts: 6122 Location: Smolensk, Russia
|
|
| Back to top |
|
 |
Die-Planer
Joined: 13 Oct 2008 Posts: 15
|
Posted: Mon Oct 12, 2009 12:31 pm Post subject: |
|
|
We are aware of this topic and designed our scripts accordingly.
I realized that we sometimes used Exception instead of UserMessageException but that had no influence on our problem.
I will try to state our problem more clearly:
- We have several user-defined fields, some can only be edited in the task, some can be changed via a message
- We use "Add Message / BEFORE Trigger" to hook up our validation scripts
- When the user submits a message and the script throws an exception all user-defined fields are beeing reset to their default values
For example, we have a memo udf "Internal Information".
It already has some content and the user adds info to it, writes a message text and submits. He forgets to enter the actual time, so our validation script throws an exception.
Now all text in the memo udf is lost.
If the user realizes this, he can restore the old content from the task data below and hopefully can remember what he added.
If the user fails to realize the lost info, he only enters the actual time, submits and the data in the udf-memo is lost completely.
To ensure that the problem is not caused by our validation script, we used one of the example scripts you provided in your documentation.
(from here: http://www.trackstudio.com/documentation/35/html/Implementing_Triggers.html)
The problem still occured.
I fail to see a configuration misstake on our side, yet if it is indeed a mistake on our behalf I'd appreciate your help in correcting it.
I am sure you can imagine how frustrating such a problem can be.
Thanks in advance. |
|
| Back to top |
|
 |
admin Site Admin

Joined: 01 Jan 1970 Posts: 6122 Location: Smolensk, Russia
|
|
| Back to top |
|
 |
admin Site Admin

Joined: 01 Jan 1970 Posts: 6122 Location: Smolensk, Russia
|
|
| Back to top |
|
 |
Die-Planer
Joined: 13 Oct 2008 Posts: 15
|
Posted: Wed Oct 28, 2009 7:19 pm Post subject: |
|
|
| admin wrote: | Please try this version
|
The problem still occurs.
It seems simple drop-down lists work now, but textboxes, listboxes and memos still loose their values with 3.5.58.
To illustrate the behaviour I prepared a little clip for you. It's an 24.5 MB, 1:18 minutes *.avi-File:
http://rapidshare.com/files/299145759/TrackStudio.avi.html
MD5: 51FCE31E28089E97ECF505F36D4801DE
(It can only be downloaded 10 times, so I hope it's still there when you get to it.) |
|
| Back to top |
|
 |
admin Site Admin

Joined: 01 Jan 1970 Posts: 6122 Location: Smolensk, Russia
|
|
| Back to top |
|
 |
Die-Planer
Joined: 13 Oct 2008 Posts: 15
|
Posted: Wed Nov 04, 2009 11:17 am Post subject: |
|
|
| admin wrote: | Please try this one
|
Thanks.
We are going to try this next week and inform you if the problem is solved as soon as we get to it. |
|
| Back to top |
|
 |
|