Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to Save the item with attachment via WEB-API in SP24

Highlighted
Jurko
Occasional Advisor

Problem to Save the item with attachment via WEB-API in SP24

Hello,
i have upgraded SD to SP24. Now there is problem to save new Item with attachment vie WEB-API. If I set fields, add a attachment, do a att transfer and then save, there is Error: java.lang.RuntimeException: You are not allowed to view this work order or this may have been deleted by another user.

I tried to make one save before adding attachment, and then add attachment into existing item and then save again. It works, but i must have permission to modify this Item. If i have a role with modify only if item is assigned to my workgroup, and i assigned new item to another workgroup there is problem to make second save with added attachments.

Any ideas?

Thanx
1 REPLY
Vasily Kamenev
Honored Contributor

Re: Problem to Save the item with attachment via WEB-API in SP24

Hi
At principal, HP web-api not allow transfer attachments to items from remote hosts. Problem located in Server - server application like read file from local file system but file really located on remote PC. If you place file to server , then your program will working. Solution is next: transfer file before to server, then use in code .setFilename();
Other way modefy AttachedItem from package com.hp.idk.rep. I'm use the second way. If you like I can post the modified class, if you don't fear use non HP code.

Vasily
//Add this to "OnDomLoad" event