Hi, I am using Alfresco community version: 5.2.0 (r135134-b14)
I have document of my own type.({http://www.alfresco.com/model/mymodel/mytype}mytype) with name "My Document Type"
I want to get name of record type in rule script. How can I get it?
var TYPE = document.type; returns TYPE {http://www.alfresco.com/model/mymodel/mytype}mytype
In Java I can get name of record using dictionaryService
TypeDefinition type = dictionaryService.getType(QName.createQName("{http://www.alfresco.com/model/mymodel/mytype}mytype"));
I cannot find any possibility in Script API to achieve this.
Have you tried to use this?
document.typeShort;
What he means is to access the dictionary definition of the type. There is no Script API for this. In previous projects I created my own thin wrapper whenever necessary, or used the Java interopability features to access the DictionaryService from JavaScript (which is cumbersome and not recommended for regular development, but for JavaScript Console use cases).
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.