on 05-12-2014 9:02 AM
Hi,
I am trying to write an import lifecycle script to delete all document links for a document say: project.
I've tried the following code, but it keeps throwing me Indexoutofbound exception, can some one help on why this error happens?
docLinks = doc.getDocumentLinkList();
docLinksSize = docLinks.size();
if(docLinksSize > 0){
for (int i=docLinksSize; i>0; i--){
docLinks.delete(docLinks.get(i-1));
}
}
Thanks.
Hi Daniel,
same thing here. Trying to delete a doc link collection member throws error:
Cannot cast class ObjectReference to class String
All I do is this
Iterator iter = doc.getDocumentLinkList().iterator();
while (iter.hasNext()) {
doc.getDocumentLinkList().delete(iter.next());
}
Did you find any solution or is there any reply from SAP?
Thanks and regards,
özlem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried using iterator?
Iterator iter = doc.getDocumentLinkList().iterator();
while (iter.hasNext()) {
doc.getDocumentLinkList().delete(iter.next());
}
PS: The delete() statement is part of AssociativeCollectionIfc so it should work the same for all references...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
As a followup to my question above, I rasied an incident to SAP and they believe this could be a defect while executing docLinks.delete() statement for Project class. Could anyone suggest any other approach that can be taken to delete decoment links in a project? I mean via scripting.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To add on, the same code is applied to MA PROCESS_ROW script, it successfully deletes existing document links in MA, but it just does not work in project PROCESS_ROW script. getting indexoutofbound exception.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.