Quantcast
Channel: SCN : Discussion List - SAP Sourcing
Viewing all articles
Browse latest Browse all 1416

Delete attachment via script not working after upgrade

$
0
0

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


Viewing all articles
Browse latest Browse all 1416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>