Hi,
I was wondering how can I get the values of the properties I've created on a custom aspect from a JS script that will be executed by a rule.
So, for example, I have the mc:refinterna aspect which has three properties: ambito, ano and ultimonumero. I've added this aspect to a space and I want to retrieve the three properties from a script and change the name of the document I'm uploading based on those properties.
Here is my script:
ambito = space.properties["refinterna:ambito]; ano = space.properties["refinterna:ano]; ultimonumero = space.properties["refinterna:ultimonumero]; document.name = ambito + "_" + ano + "_" + ultimonumero + ".pdf"; document.save()
When I upload a document it is saved as null_null_null.pdf, so clearly I'm not referencing the properties correctly.
Can anyone please help me with this?
Regards,
Pedro
How you are adding aspect and properties to document?
During upload By default that aspect is not added.
Try with :
ambito = space.properties["refinterna:ambito"]; ano = space.properties["refinterna:ano"]; ultimonumero = space.properties["refinterna:ultimonumero"]; document.name = ambito + "_" + ano + "_" + ultimonumero + ".pdf"; document.save()
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.