<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trying to destroy files using JavaScript in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118493#M32673</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm trying to create a JavaScript file that destroy files when possible. However, I'm not finding a way to do that since, aparently, doesn't exist a document.destroy.&lt;/P&gt;&lt;P&gt;Is there some especific function that does this?&lt;/P&gt;</description>
    <pubDate>Tue, 05 Oct 2021 16:26:08 GMT</pubDate>
    <dc:creator>Pedro_Merces</dc:creator>
    <dc:date>2021-10-05T16:26:08Z</dc:date>
    <item>
      <title>Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118493#M32673</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm trying to create a JavaScript file that destroy files when possible. However, I'm not finding a way to do that since, aparently, doesn't exist a document.destroy.&lt;/P&gt;&lt;P&gt;Is there some especific function that does this?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 16:26:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118493#M32673</guid>
      <dc:creator>Pedro_Merces</dc:creator>
      <dc:date>2021-10-05T16:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118494#M32674</link>
      <description>&lt;P&gt;You may use Alfresco JSConsole addon:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.venzia.es/alfresco-javascript-console/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.venzia.es/alfresco-javascript-console/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This tools includes a full reference of Alfresco Repository JavaScript API.&lt;/P&gt;
&lt;P&gt;Anyway, I guess you are looking for &lt;STRONG&gt;document.remove()&lt;/STRONG&gt; method.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 16:47:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118494#M32674</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-10-05T16:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118495#M32675</link>
      <description>&lt;P&gt;Thanks for the answer, but when I try to execute the method &lt;STRONG&gt;document.remove(),&lt;/STRONG&gt; I get the following message:&lt;BR /&gt;&lt;BR /&gt;"09061538 Failed to execute script 'workspace://SpacesStore/58b89198-b52b-417c-a311-e9cc1c4f4fc3': Node does not exist: workspace://SpacesStore/60f67e94-6e73-42a2-8f3b-7eefc5e174f0 (status&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://connect.hyland.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;tatus[id=85115changeTxnId=0f6fd51b-248e-4cd8-b3d9-c1bcf4d43649, dbTxnId=13929, deleted=true])"&lt;BR /&gt;&lt;BR /&gt;Besides that, the addon just make things easier when it comes to test the script, anyway, I don't have the possibility of installing an addon such as the JSConsole, so this option is unviable.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 11:52:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118495#M32675</guid>
      <dc:creator>Pedro_Merces</dc:creator>
      <dc:date>2021-10-06T11:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118496#M32676</link>
      <description>&lt;P&gt;Probably you're trying to remove the document in the same DB Transaction you are creating it.&lt;/P&gt;
&lt;P&gt;That operation is not supported, since every JS script runs in a single DB Transaction.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 11:55:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118496#M32676</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-10-06T11:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118497#M32677</link>
      <description>&lt;P&gt;My document was already created before the script and the only change I'm making is switch a option on the metadata to trigger the script.&lt;BR /&gt;&lt;BR /&gt;To exclusively test this, my code is only the method &lt;STRONG&gt;Document.remove(),&lt;/STRONG&gt; I've already tried&amp;nbsp;&lt;STRONG&gt;Document.parent.remove()&lt;/STRONG&gt;, but both of them gives the same error.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 12:11:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118497#M32677</guid>
      <dc:creator>Pedro_Merces</dc:creator>
      <dc:date>2021-10-06T12:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118498#M32678</link>
      <description>&lt;P&gt;I made a simple tests and &lt;STRONG&gt;document.remove()&lt;/STRONG&gt; works as expected.&lt;/P&gt;
&lt;P&gt;I guess the problem is related with the metadata updating, since the document is removed and &lt;EM&gt;after that&lt;/EM&gt; Alfresco is trying to update that metadata property. May you try triggering removal by using some other method?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 08:10:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118498#M32678</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-10-07T08:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118499#M32679</link>
      <description>&lt;P&gt;Or alternatively, provide the actual script that you are trying to execute, instead of just the single instruction. As well as the whole stacktrace that belongs to the error, not just the message. That way it'd be a lot easier to help pinpoint the cause of it.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 08:40:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118499#M32679</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2021-10-07T08:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118500#M32680</link>
      <description>&lt;P&gt;I made some changes and the function worked, but thats not what I am looking for. The method &lt;STRONG&gt;document.remove()&lt;/STRONG&gt; deletes the document, I want to destroy it, preservating the metadata of the file.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 11:48:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118500#M32680</guid>
      <dc:creator>Pedro_Merces</dc:creator>
      <dc:date>2021-10-07T11:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118501#M32681</link>
      <description>&lt;PRE&gt;document.content = "";&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Oct 2021 11:59:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118501#M32681</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-10-07T11:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118502#M32682</link>
      <description>&lt;P&gt;My objective isn't erasing the content of my file, it is to use the destroy function of alfresco through JavaScript.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 12:49:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118502#M32682</guid>
      <dc:creator>Pedro_Merces</dc:creator>
      <dc:date>2021-10-07T12:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118503#M32683</link>
      <description>&lt;P&gt;Can you provide a reference for that "destroy" function? Is something coming from the Java API?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 12:54:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118503#M32683</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-10-07T12:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118504#M32684</link>
      <description>&lt;P&gt;&lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-hub/records-management-user-guide/ba-p/289598" target="_blank" rel="nofollow noopener noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-content-services-hub/records-management-user-guide/ba-p/289598&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This link shows the properties of some functions, including the rma&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocessDestruction, which represents the destroy function. However when I try to get the boolean value of it, it returns undefined.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 13:33:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118504#M32684</guid>
      <dc:creator>Pedro_Merces</dc:creator>
      <dc:date>2021-10-07T13:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118505#M32685</link>
      <description>&lt;P&gt;So you are using Record Management module with Enterprise (following the DOD 5015.2 structure).&lt;/P&gt;
&lt;P&gt;In order to get the value of that property (rma&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocessDestruction), the node type needs to a file plan (rma:filePlan).&lt;/P&gt;
&lt;P&gt;Is your node of this type?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 13:46:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118505#M32685</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-10-07T13:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118506#M32686</link>
      <description>&lt;P&gt;Yes, my node is a file plan.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 14:20:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118506#M32686</guid>
      <dc:creator>Pedro_Merces</dc:creator>
      <dc:date>2021-10-07T14:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118507#M32687</link>
      <description>&lt;P&gt;And the result of the following line is null?&lt;/P&gt;
&lt;PRE&gt;var destroy = document.properties["rma:processDestruction"];&lt;/PRE&gt;
&lt;P&gt;That may indicate also &lt;STRONG&gt;false&lt;/STRONG&gt;. Does this make sense?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 14:32:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118507#M32687</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-10-07T14:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to destroy files using JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118508#M32688</link>
      <description>&lt;P&gt;my code is:&lt;BR /&gt;&lt;BR /&gt;if (document.properties["rma&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocessDestruction"] == true){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.properties["rmc:TipoDeDocumento"] = "success";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else if (document.properties["rma&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocessDestruction"] == false){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.properties["rmc:TipoDeDocumento"] = "error";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.properties["rmc:TipoDeDocumento"] = "none";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;document.save();&lt;/P&gt;&lt;P&gt;But it only changes to none.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 14:53:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-destroy-files-using-javascript/m-p/118508#M32688</guid>
      <dc:creator>Pedro_Merces</dc:creator>
      <dc:date>2021-10-07T14:53:13Z</dc:date>
    </item>
  </channel>
</rss>

