back to top

Running and Downloading a Printable via Javascript in Creatio

To run/create a printable in Creatio via client-side Javascript on a page, there’s an easy to use web service. We can also use the ServiceHelper module to make it easy to create the printable document as well.

To run a printable and download the doc via code, first add the ServiceHelper module to the modules list at the top of the page. Additionally, if we want to show the “loading” animation while the printable is being created, we can also add the MaskHelper module as well.

define("UsrMyCustom1Page", ["ServiceHelper", "MaskHelper"], function(ServiceHelper, MaskHelper) {

With the modules added to the top of the page, the code to create the printable document would look as follows:

// Notę, the reportId below is the Id of the printable.
// You can get this from the end of the URL when edit the printable in the report setup screen
var reportId = "7f5de1ad-fb4b-2ad6-b6fc-4f05f30a7f0f";

// we'll pass the below to the service. The recordsIds is the record (or records) the printable will be run for				
var serviceData = {
	"templateId": reportId,
	"recordIds": [ this.get("Id") ]
};

// show loading indicator
MaskHelper.ShowBodyMask();
			
// call the service
ServiceHelper.callService("ReportService", "CreateReportsList", function(response) {
	MaskHelper.HideBodyMask();
	
	// now download the file
	var elem = document.createElement("a");
	elem.href = "../rest/ReportService/GetReportFile/" + CreateReportsListResult[0];
	elem.download = "ReportName";
	if (Ext.isIE) {
		elem.target = "_blank";
	}
	document.body.appendChild(elem);
	elem.click();
	document.body.removeChild(elem);
}, serviceData, this);

The result is that when the code above executes, the printable will be created and downloaded. The user will simply see a quick loading animation and then a file will download.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Ryan Farley
Ryan Farleyhttps://customerfx.com/article/author/ryanfarley/
Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Using the AI Prompt to Create Dynamic Folders in Creatio

Using Creatio's AI prompt to create the filter for a dynamic folder works best if you specifically ask for that, and if you are as clear and direct as possible about the filtering, conditions.

Related Articles

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Related Videos