Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
IManRelatedDocuments.RemoveRelation problems
izogi
Hello. Are there any known problems with the IManRelatedDocuments.RemoveRelation() method? I have a broken unit test that tries to add and remove related documents (but fails with removing) and can't figure out what I'm doing wrong.
I'm coding against the IManage.dll file from Worksite 8.2.778 (the IManage.dll file version is 8.2.121.8). When I call the .RemoveRelation(docNumber) method, no exception is raised but the relation I was trying to remove still exists.
What I have is similar to:
==========
bool result;
IManDocument doc1, doc2;
// ...
// ... create a couple of new documents, which (through creating them) should ensure appropriate access to tinker with relations.
// ...
// Confirm there are no relations to begin with.
Assert.AreEqual(0, doc1.RelatedDocuments.Count);
result = doc1.RelatedDocuments.AddRelation(doc2, "test relation");
// Confirm a relation from doc1 to doc2 was definitely added.
Assert.AreEqual(true, result);
Assert.AreEqual(1, doc1.RelatedDocuments.Count);
// At this point, doc1 has a relation to doc2.
// Now attempt to remove the doc2 relation from doc1.
doc1.RelatedDocuments.RemoveRelation(doc2.Number);
// So by now, the number of related documents for doc1
// should be back to 0.
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// The following assertion fails!
Assert.AreEqual(0, doc1.RelatedDocuments.Count);
==========
I've stepped through my code over and over again, and it seems that the RemoveRelation() method simply acts as if it's doing nothing. It doesn't return any value (nor is it supposed to) or raise any exception, so there's no clear indication of anything wrong happening. Is there something else I need to do to force the removed relation to be committed or saved somehow?
Thanks very much for any help.
Mike.
Find more posts tagged with
Comments
There are no comments yet