cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting Document link via Script

0 Kudos

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);

       }

   }

}

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Got the solution... Thanks