Hi Experts
I am trying to delete a Document Link. The script deletes the document link, but gives the below error as well.
Target exception: java.lang.ClassCastException: Cannot cast class com.sap.odp.common.db.ObjectReference to class java.lang.String
Below is my script. Please assist as to where I can fix it
docLinkList = doc.getDocumentLinkList();
if (docLinkList.size() > 0)
{
docIter = docLinkList.iterator();
while(docIter.hasNext())
{
linkmember = docIter.next();
Relationship = linkmember.getLinkDefinitionObjRef().getDisplayName().toString();
if (Relationship.equals("Related Project"))
{
docLinkList.delete(linkmember);
}
}
}