Skip to main content

alphaWorks  >  Forums  >  IBM Rational Team API  >  developerWorks

Add Field Values to Reference_LIST type Fild using TeamAPI    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
Permlink Replies: 3 - Pages: 1 - Last Post: Sep 16, 2009 6:04 AM Last Post By: bashboush Threads: [ Previous | Next ]
SeungUk,Kang

Posts: 22
Registered: Mar 08, 2006 11:34:51 PM
Add Field Values to Reference_LIST type Fild using TeamAPI
Posted: May 29, 2007 12:44:21 AM
Click to report abuse...   Click to reply to this thread Reply
Hi all experts,

I am wondering it is possible adding field value to existing refereced_list filed using TeamAPI.

Usual case when modifying record. I used following code..

...
RequestList wantedProps = new RequestList(new TargetProperties(TeamProperties.RECORD_PROPERTIES_FOR_MODIFY));

record.doStartAction(action, wantedProps, false);
record.setProperty(record.fieldPropertyName(targeField), entry.getValue());
record.doWriteProperties();
record.doDeliver(null);

...

But I don't think it will work setProperty with Referece_LIST file to add new field refrece( like the COM API method - "AddFieldValue" ).

Is there any other way?
Thomas R. Wilcox

Posts: 89
Registered: Jun 07, 2006 07:58:32 AM
Re: Add Field Values to Reference_LIST type Fild using TeamAPI
Posted: May 29, 2007 08:39:42 AM   in response to: SeungUk,Kang in response to: SeungUk,Kang's post
Click to report abuse...   Click to reply to this thread Reply
You should be able to set the values for a REFERENCE_LIST field using a ResourceList object as the argument for the Resource.setProperty method. However, I believe, in the 7.0.1 version of TeamAPI, there was a defect in this regard. I thought there was a forum topic on that issue, but I cannot find it.

There are a few other alternatives, one of which must work for you.

But before we go into the options, I'd like to see just what error you are seeing using ResourceList() as the value of a field.

[i]Also note, in all cases, whatever list of values you write to the RESOURCE_LIST field will entirely replace the list already defined by the record. If you just want to add a value to the list, then you will have to read the current list, add the new elements, and then write the entire list back.[/i]
Haeussler

Posts: 11
Registered: Jan 26, 2005 02:34:16 AM
Re: Add Field Values to Reference_LIST type Fild using TeamAPI
Posted: Mar 18, 2008 07:04:21 AM   in response to: Thomas R. Wilcox in response to: Thomas R. Wilcox's post
Click to report abuse...   Click to reply to this thread Reply
Hello,

can you give me a example or the link to the forum topic?

Thanks

Christian Haeussler
HUK COBURG

Message was edited by: Haeussler
bashboush

Posts: 3
Registered: May 09, 2008 05:45:44 AM
Re: Add Field Values to Reference_LIST type Fild using TeamAPI
Posted: Sep 16, 2009 06:04:09 AM   in response to: Haeussler in response to: Haeussler's post
Click to report abuse...   Click to reply to this thread Reply
Hi, did you find any solution for that?

I could only save if there are no references .
updating the references comes up with a NPE:
ntity could not be updated:
conflict: CQ-Ausnahme abgefangen
...java.lang.NullPointerException:
...
Caused by: java.lang.NullPointerException
at com.ibm.rational.stp.client.internal.cqjni.CqJniActionMgrRecord.updateResourceListField(CqJniActionMgrRecord.java:634)
at com.ibm.rational.stp.client.internal.cqjni.CqJniActionMgrRecord.updateProperty(CqJniActionMgrRecord.java:399)
at com.ibm.rational.stp.client.internal.cqjni.CqJniActionMgr.updateResource(CqJniActionMgr.java:433)
at com.ibm.rational.stp.client.internal.cqjni.CqJniActionMgr.doIt(CqJniActionMgr.java:299)
... 30 more
any idea?

Point your RSS reader here for a feed of the latest messages in all forums