cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Document using automation chain which is called in event documentCreated

Reethu_Das
Champ in-the-making
Champ in-the-making

I am trying to create an automation chain which is called on the event 'documentCreated' and newly uploaded document is saved as attachment on another document. But after attaching, this newly uploaded document is also created as new document. I want to avoid that. I want to delete that newly created document.

Can anyone help me with this? I tired to use operation document.delete(), but entire chain is rolled back because I'm calling it in documentCreated.

So what should I do to delete newly created document? Which event handler should I use?

Thanks in advance.

5 REPLIES 5

LaraGranite_
Star Contributor
Star Contributor

What do you mean by "newly uploaded document is saved as attachment on another document." It sounds like you are uploading a binary to save as an attached file on an existing Nuxeo document. Could you give us more information on what you're trying to accomplish?

Reethu_Das
Champ in-the-making
Champ in-the-making

My requirement is that,

LaraGranite_
Star Contributor
Star Contributor

Thanks for the further explanation. I'm still not clear on how you are attaching documents to documents. Are they relations? Or are you uploading file documents? Could you post the automation chain here? Maybe you should use documentModified instead of created.

Reethu_Das
Champ in-the-making
Champ in-the-making

But I'm using Create Version operation in the chain. So chain can't be called in document modified right?

Reethu_Das
Champ in-the-making
Champ in-the-making

In Chain, while uploading a document, i'm checking for similar file name and if found a document with same file name then Blob.AttachOnDocument is called to attach to old document as main content with updated version.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.