| Author |
Message |
Tariq
Guest
|
Posted:
Tue Jan 11, 2005 7:59 pm Post subject:
Progamtically Remove Related Items from an Issue Item |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
 |
|
|
|
|