Progamtically Remove Related Items from an Issue Item
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Progamtically Remove Related Items from an Issue Item

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
Tariq
Guest





Posted: Tue Jan 11, 2005 7:59 pm    Post subject: Progamtically Remove Related Items from an Issue Item Reply with quote

Hi,

Has anyone been succesfull in being able to remove the related Issues for a
Issue list item programatically.

I havent found anything in the API that will let me do this.

Appreciate your views,

Tariq
Back to top
Jim Duncan
Guest





Posted: Wed Jan 12, 2005 12:28 am    Post subject: Re: Progamtically Remove Related Items from an Issue Item Reply with quote

Hi Tariq,

As far as I know, the Related Issues is just a field in the Issues list. I
imagine that if you set it to empty the related issues would go away.
This is just a guess:

item["RelatedID"] = null;
item["Related Issue"] = null;
item.Update();

-Jim

"Tariq" <Tariq@discussions.microsoft.com> wrote in message
news:7792F4FB-82A8-4D7B-AEBD-90EE0209E071@microsoft.com...
Quote:
Hi,

Has anyone been succesfull in being able to remove the related Issues for
a
Issue list item programatically.

I havent found anything in the API that will let me do this.

Appreciate your views,

Tariq
Back to top
Tariq
Guest





Posted: Wed Jan 12, 2005 10:57 am    Post subject: Re: Progamtically Remove Related Items from an Issue Item Reply with quote

Hey Jim,

I would love that to work, but setting it to null has not effect.

SPSite site = new SPSite("http://server");
SPWeb web = site.AllWebs["sites/site"];
SPList list = web.Lists["issues"];
SPListItem item1 = list.Items.GetItemById(1);

item1["RelatedID"] = null;
item1.Update();

However the readonly field "RemoveRelatedID" is a bit suspicious, but
i've had no luck all round trying to get this to work.

- Tariq
Back to top
Jim McCusker
Guest





Posted: Thu Jan 20, 2005 7:37 pm    Post subject: Re: Progamtically Remove Related Items from an Issue Item Reply with quote

If you want to truely remove the related item you can always use the
RelatedID as the reference to the item you want to delete.

SPListItem item1 = list.Items.GetItemById(1);
SPListItem relatedItem = list.Items.GetItemById(item1["RelatedID"] );
relatedItem.Delete();
relatedItem.Update();

"Tariq" wrote:

Quote:
Hey Jim,

I would love that to work, but setting it to null has not effect.

SPSite site = new SPSite("http://server");
SPWeb web = site.AllWebs["sites/site"];
SPList list = web.Lists["issues"];
SPListItem item1 = list.Items.GetItemById(1);

item1["RelatedID"] = null;
item1.Update();

However the readonly field "RemoveRelatedID" is a bit suspicious, but
i've had no luck all round trying to get this to work.

- Tariq

Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB