Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Programatically remove related issues from an Issue Item

  Asked By: Efrain    Date: Jul 20    Category: Sharepoint    Views: 14490

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

I haven’t found anything in the API that will let me do this.

Appreciate your views,



7 Answers Found

Answer #1    Answered By: Sterling Allison     Answered On: Jul 20

You can hide it from the Form

Go in Frontpage in the Editform.aspx and newform.aspx

Locate the tag <td> where the field is located and add style=”display:none”

Answer #2    Answered By: Jessie Burton     Answered On: Jul 20

I tried this and cannot find a tag <td> with the related  issues field associated with it. The whole form seems to be a Web Part. How can I easily get into the WebPart and modify it so this field no longer shows up.

Answer #3    Answered By: Kristopher Morales     Answered On: Jul 20

You need to right click on the web part and Select “Customize Sharepoint List Form”. This will create a HTML based table with webbot tags for each field.

At that time, you should be able to select <td> or <tr> and add the style

Answer #4    Answered By: Marquis Ortega     Answered On: Jul 20

Thanks for you comments.

But I guess I might have miss-communicated my requirement.

What I want is, if an issue  with Issue ID 1 has Issues with IDs 4 and 10 related  to it, I want to remove  the relation between 4, 10 and 1 through code.

I’ve looking for a means through the API to remove relations from issue items.

So far this is what I’ve got; each relation amongst items in an Issue list  has GUID to represent the relation. This GUID is stored in the “RelationID” field of the list item. The list item  also contains a field called “RemoveRelatedID” which is read-only. Its value at runtime is the same as that of the list item’s title.

So far what I’ve been able to piece together is that, the original issue edit form processes the ‘Remove Related Item’ functionality through the owssvr.dll. I believe the owssvr.dll parses the CAML on the EditForm when the ‘Remove’ is clicked for a related Item and deletes the relation for the item. I have a suspicion that this is done through unmanaged code in the dll. The only thing I can deduce is that the relations between list items must be a hidden list in SharePoint with the RelatedID being the keyfield.

Any thoughts?

Answer #5    Answered By: Javier Hawkins     Answered On: Jul 20

Yes the Edit Form looks like one big WebPart, but it isn’t. Underneath the main WebPart, there are 2 other WebParts with frame style set to none. You could place these 2 within a new table row with style:”display:none” as Daniel mentioned.

Answer #6    Answered By: Tracy Bass     Answered On: Jul 20

I didn't do a lot of research into this but it looks like the following
JavaScript is executed on the client to remove  related issues:
function RemoveRelated(url, itemid, listid)
var L_DeleteRelated_text = "Removing an issue  from this list  removes
only its relationships to the related  items. The related items
themselves are not affected.";
if (confirm(L_DeleteRelated_text))
var rowid = "idRelatedIssueRow"+itemid;

value += itemid + ";";
var relatedIssueTable =
if (relatedIssueTable != null)
var rowTobeDeleted = relatedIssueTable.rows.item(rowid);
if (rowTobeDeleted != null)
if (relatedIssueTable.rows.length == 1)


I speculate that when the user clicks Save and Close that any issues  in
the hidden table are saved into the database as being related.

Not sure if that helps or not,

Answer #7    Answered By: Dominick Blake     Answered On: Jul 20

Definitely an angle I will try out.

Didn't find what you were looking for? Find more on Programatically remove related issues from an Issue Item Or get search suggestion and latest updates.