05-25-2017 06:22 AM
I found this code to create a file from a template
// Data to fill in the template var num = "42"; var buyer = "Acme, Inc"; var sum = "700$"; // Get template file var tempFile = search.findNode( "workspace://SpacesStore/262981fb-e141-43bd-ac63-9b8199eb1077" ); // Get target folder var folder = search.findNode( "workspace://SpacesStore/ef296491-90ff-4427-a06a-31fd4abf4245" ); // Name of new file to be created var name = "Invoice " + num; // Create string with data to fill the template. // Parameters names (number, company, amount) match the names in the template. var data = jsonUtils.toJSONString( {"Number": num, "CustomerName": buyer, "Amount": sum} ); // Create new file template.generate( tempFile, folder, name, data );
But it does not work says not foundjsonUtils andtemplate.generate
Tell me how to fix this or how to create a file from the template correctly
05-27-2017 07:58 AM
where is the script with this snippet? what version of alfresco are you using?
05-27-2017 08:15 AM
I'm new in alfresco. I try to write such a script, but it does not work.Im using 5.2 version.I want to create file with template at ui of process
Explore our Alfresco products with the links below. Use labels to filter content by product module.