Trying to destroy files using JavaScript

cancel
Showing results for 
Search instead for 
Did you mean: 
angelborroy
Alfresco Employee

Re: Trying to destroy files using JavaScript

Can you provide a reference for that "destroy" function? Is something coming from the Java API?

Hyland Developer Evangelist
Pedro_Merces
Member II

Re: Trying to destroy files using JavaScript

https://hub.alfresco.com/t5/alfresco-content-services-hub/records-management-user-guide/ba-p/289598

This link shows the properties of some functions, including the rmaSmiley TonguerocessDestruction, which represents the destroy function. However when I try to get the boolean value of it, it returns undefined.

angelborroy
Alfresco Employee

Re: Trying to destroy files using JavaScript

So you are using Record Management module with Enterprise (following the DOD 5015.2 structure).

In order to get the value of that property (rmaSmiley TonguerocessDestruction), the node type needs to a file plan (rma:filePlan).

Is your node of this type?

Hyland Developer Evangelist
Pedro_Merces
Member II

Re: Trying to destroy files using JavaScript

Yes, my node is a file plan.

angelborroy
Alfresco Employee

Re: Trying to destroy files using JavaScript

And the result of the following line is null?

var destroy = document.properties["rma:processDestruction"];

That may indicate also false. Does this make sense?

Hyland Developer Evangelist
Pedro_Merces
Member II

Re: Trying to destroy files using JavaScript

my code is:

if (document.properties["rmaSmiley TonguerocessDestruction"] == true){

     document.properties["rmc:TipoDeDocumento"] = "success";

}

else if (document.properties["rmaSmiley TonguerocessDestruction"] == false){

     document.properties["rmc:TipoDeDocumento"] = "error";

}

else{

     document.properties["rmc:TipoDeDocumento"] = "none";

}

 

document.save();

 

But it only changes to none.