0 votes

Hi there,

I'm trying to delete a file (attachment) via SOAP.

When executing the following SOAP request:

    <data id="0" operation="delete" entity="FILE" keys="123"/>

I get the following "answer":

    <faultstring>Invalid Entity for Delete</faultstring>

I also tried entity="2", same effect. When logging in as the user i use to perform the SOAP request, i am able to delete the attachment without a problem. So, how can I delete a FILE entry?

Thanks in advance,

closed with the note: Works as intended, thanks!
asked in How to by (177 points)
closed by

2 Answers

+1 vote
Best answer

A good rule is that you have to use the SOAP interface just like the user interface handles entities. How do you delete a file in Efficy? Well you edit the document, and remove the file. Then you commit. Soap is not any different, so what you miss is the edit context of the document.

I tested the SOAP example below on my test DB and that works well

<efficy:edit entity="Docu" key="161" commit="true" closecontext="true">
    <deletedetail detail="File" detailkey="286_0"/>
answered by (7.4k points)
selected by
Great, thanks Kristof!

I already tried to delete it this way, but that didn't work too, because i didn't pass the _0. This seems to be the revision of the file, i guess.

Ah yes, the primary key is the combination of K_FILE and VERSION, so it's kind of logic that it need to be passed.

Could you mark the questions as "Answered" please if you confirm it works
0 votes

Have you try with the entity written like this : 'File' ?

answered by (1.9k points)
Hello Stéphane,

the same goes for File.

Welcome to Efficy Overflow, where you can ask questions and receive answers from other members of the community.
1,249 questions
1,518 answers
328 users