How to get a field's value?

Discuss problems installing or using TrackStudio.

How to get a field's value?

Postby bodbupnik » Tue May 11, 2010 1:14 pm

Good day, everybody. I have a next two questions, both of them according with a field's names:
1) How can I check in a script the value of a standart trackstudio fields: "Code" and "Status"? I was looked for some method like "getId" or "getDescription" in com.trackstudio.secured.SecuredTaskMessageBean class and didn't find it.. ? I tried all "get" methods, given in documentation and nothing
2) And is there a possible to use and compare, in a trigger before_edit_task for example, the old and the new value of the same field?
That's all, thank you.
bodbupnik
 
Posts: 10
Joined: Tue Apr 20, 2010 10:45 am

Re: How to get a field's value?

Postby Petr » Tue May 11, 2010 3:54 pm

Hi.
What version TrackStudio you use?
TS Support
email: parsentev@yandex.ru
Petr
 
Posts: 1125
Joined: Wed Aug 12, 2009 4:38 pm

Re: How to get a field's value?

Postby bodbupnik » Tue May 11, 2010 4:02 pm

Petr wrote:Hi.
What version TrackStudio you use?


oh, forget again, it's 4.20 ts
bodbupnik
 
Posts: 10
Joined: Tue Apr 20, 2010 10:45 am

Re: How to get a field's value?

Postby Petr » Tue May 11, 2010 4:20 pm

You need use com.trackstudio.secured.SecuredTaskTriggerBean
1. In the trigger have used object SecuredTaskTriggerBean
Code: Select all
SecuredTaskTriggerBean task = new SecuredTaskTriggerBean(...);

and you will access all method this class.
For get field "Status" have method get getStatus(). He return object SecuredStatusBean.
Code: Select all
task.getStatus().getName()

For get field "Code" have method get getNumber(). He return number task.
Code: Select all
task,getNumber()

2. You need get old task. May do this.
Code: Select all
SecuredTaskBean oldTask = new SecuredTaskBean(input.getId(), sc);
TS Support
email: parsentev@yandex.ru
Petr
 
Posts: 1125
Joined: Wed Aug 12, 2009 4:38 pm


Return to TrackStudio Support

Who is online

Users browsing this forum: No registered users and 2 guests