Hi All,
Recently we have upgraded our sourcing system to version 10. We have written script to delete attachment via script. It was working fine but after upgrade we are getting below error:
target exception : at Line: 474 : in file: inline evaluation of: ``import java.util.Calendar; import com.sap.odp.api.common.types.TypeFactory; im . . . '' : .delete ( docLinks .get ( i ) )
Target exception: java.lang.ClassCastException: Cannot cast class com.sap.odp.common.db.ObjectReference to class java.lang.String
Piece of code for attachment deletion:
docLinks = newMA1.getDocumentLinkList();
for(int i=0;i<docLinks.size();i++) {
docLinkLine = docLinks.get(i);
name = docLinkLine.getLinkDocId();
relationship = docLinkLine.getLinkDefinitionObjRef().getDisplayName();
if(name.equalsIgnoreCase("102_OLA_102") && relationship.equalsIgnoreCase("Master Agreement Template")) {
newMA1.getDocumentLinkList().delete(docLinks.get(i));
}
}
Please help us to resolve this issue