How do I clone the 'PRINT' button drop down and functionality? I want to create new list of prinatable lets call that PRINT2 and only list certain printables there 

 

Since we can't have dependent filter based on value of field, I can have predefined filter for those dropdown it will only show them. The reason is we have long list of printables and we want to organize them. Thank you!

Like 0

Like

2 comments

If the system has a lot of printables you could try the approach of adding a lookup to select and run a printable (since then they have a searchable list). I did this for a system a long time ago and worked great. 

I have the code here: https://gist.github.com/RyanFarley/46a9fe7513ff927ed6d66ed3fc0f0137

The end result was this:

Also, for the system I did this for, we only checked the "show in edit page" option for the common printables so they still showed in the print menu as a much shorter list, but all the rest were available in the lookup.

Ryan

Hello Tony,

 

You can clone Print button and apply filters by following these steps:

 

1. add the button to your page;

2. add collection attribute and bind button menu items to it

 

attributes: {
	"CardPrintMenuItemsTest": {
		dataValueType: Terrasoft.DataValueType.COLLECTION
	}
}

 

diff: /**SCHEMA_DIFF*/[
	{
		"operation": "insert",
		"name": "TestButton",
		"values": {
			"itemType": 5,
			"caption": "Print Test",
			"style": "blue",
			"controlConfig": {
				"menu": {
					"items": {
						"bindTo": "CardPrintMenuItemsTest"
					}
				}
			}
		},
		"parentName": "LeftContainer",
		"propertyName": "items",
		"index": 10
	}

 

3. set the value of created collection attribute in the source code

 

methods: {
	onEntityInitialized: async function() {
		this.callParent(arguments);
		var testStringValue = this.get("UsrTestString");               
		setTimeout(this.initCustomPrintButton(testStringValue), 3000);
	},
	initCustomPrintButton: function(val){
		var printItems = 		this.get(this.moduleCardPrintFormsCollectionName);
               printItems.collection.items = printItems.collection.items.filter(x => x.values.Caption.includes(val));
	this.set("CardPrintMenuItemsTest", printItems);
	}
}
Show all comments

Hi,

I have implemented two different scenarios using PrintReportUtilities mixin methods. The first one (generateCardPrintForm) is to save the printable as an attachment in the Attachment and Note detail, and the other one (initCardPrintForms and preparePrintFormsMenuCollection) is used to filter the printables on the basis of lookup. The code is working fine but after refreshing the page.

 

The code used in OrderPageV2 is as follows

generateCardPrintForm: function(tag) {
	// first get the printable being accessed
	var printFormsCollection = this.get(this.moduleCardPrintFormsCollectionName),
		printForm = printFormsCollection.get(tag);
	var printableId = printForm.values.Id;
	var orderId = this.get("Id");
	ProcessModuleUtilities.executeProcess({
		sysProcessId: '68880f82-xxxx-xxxx-xxxx-xxxxxfb532c2',
		parameters: {
			OrderId: orderId,
			PrintableId: printableId
		}
	});
	this.updateDetail({detail: "Files"});
	this.callParent(arguments);
}

 

initQueryColumns: function(esq) {
	this.callParent(arguments);
 
	if (!esq.columns.contains("UsrDocumentRepositorySubtype")) {
		esq.addColumn("UsrDocumentRepositorySubtype");
	}
},
initCardPrintForms: function() {
	this.callParent(arguments);
	var printMenuItems = this.get(this.moduleCardPrintFormsCollectionName);
	if (Ext.isEmpty(printMenuItems)) return;
	printMenuItems.each(function(item) {
		item.set("Visible", {bindTo: "getPrintMenuItemVisible"});
	}, this);
},
initSectionPrintForms: function() {
	this.callParent(arguments);
	var printMenuItems = this.get(this.moduleSectionPrintFormsCollectionName);
	if (Ext.isEmpty(printMenuItems)) return;
	printMenuItems.each(function(item) {
		item.set("Visible", {bindTo: "getPrintMenuItemVisible"});
	}, this);
},
preparePrintFormsMenuCollection: function(printForms) {
	printForms.eachKey(function(key, item) {
		if (!item.get("Caption")) {
			item.set("Caption", item.get("NonLocalizedCaption"));
		}
		item.set("Tag", key);
		item.set("Visible", {bindTo: "getPrintMenuItemVisible"});
	}, this);
},
// this is the function will determine if a printable is visible
// it is called for each printable and will return true/false to show or hide
getPrintMenuItemVisible: function(reportId) {
	var type = this.get("Status") || { displayValue: "" },
		printMenuItems = this.get(this.moduleCardPrintFormsCollectionName),
		item = printMenuItems.find(reportId);
	if (Ext.isEmpty(item)) return;
 
	switch (item.get("Caption")) {
		case "Order - Inprocess":
			return type.displayValue === "3. In progress";
		default:
			return type.displayValue != "3. In progress";
	}
}

 

Like 0

Like

4 comments

Hello,

 

It happens because of the combined mode and the fact that logic is triggered not from the page itself, but from the section page (when you open record from the section) until the page is reloaded. It's the same issue as if you add buttons to the page schema, not section schema (as described here). In such case you won't be able to see buttons on the page until the page reload. So you need to modify the logic and apply it in the section schema (OrderSectionV2).

Oleg Drobina,

 

I have added the code to OrderSchemaV2, but the issue is still the same.

Syed Ali Hassan Shah,

 

Unfortunately additional debugging needed here. Also there is a probability that the whole approach should be changed. Here are also two marketplace addons, one of them performs filtration of printables and another one adds printables to attachments:

 

https://marketplace.creatio.com/app/printable-attachments-creatio

https://marketplace.creatio.com/app/opportunity-printables-filtering-roles-creatio

 

You can also review how they work and maybe it will help in implementing your own logic.

Oleg Drobina,

 

I have gone through the mentioned plugins they are using the custom implementation in their own developed buttons and custom library. But we want to override the implementation done by Creatio.

 

Show all comments

Hello Community,

 

Is there a way to hide empty columns of a table in a printable?

 

Thank you

Like 0

Like

1 comments

Hello, 



Unfortunately, as for now, there is no possibility to implement your business task and we do have the correspondent problem registered on our side and R&D team is currently working on implementing this new functionality in one of the future releases of the application.



Thank you for helping us to make our application better.



Best regards,

Orkhan

Show all comments

We have a use case where when a user clicks PRINT and selects a printable, we need to save the Printable in the Attachment detail in the Opportunity record, not download the file.

We have managed to save the Printable docx on a modified Opportunity field, but couldn't work out the code triggered upon clicking a Printable in the PRINT menu.

Can you guide us to where we need to make the change?

File attachments
Like 0

Like

3 comments

Hello,

 

You can use this addon to complete your task - https://marketplace.creatio.com/app/printable-attachments-creatio

 

Best regards,

Yuliya Gritsenko

Yuliya Gritsenko,

Hi Yuliya,

 

Thank you for the response. Ideally, we do not want the user to go to the record and then to the Attachments tab every time. We want to show that a user can quickly generate a document using a PRINT menu and automatically save it in the Attachments tab if possible.

 

Isn't there a System Setting where we can select whether to download a printable or save it in the Attachment tab?

 

Regards,

Ammar

Ammar,

Hello Ammar,

 

Unfortunately, we do not have ready examples of the implementation of this feature the way you need.

The only difference between the implementation via the addon and the way you ask is that in the addon implementation you will need to go to the Attachments and Notes tab and click the button there.

By the way, it is possible to set up so that the detail is displayed in the first tab.

 

Best regards,

Yuliya Gritsenko

Show all comments

Dear,

I want to add the "UsrUniteDeVente" product field on my opportunity print.

But when i want to select the field, i can not select it, it is not in the list:

Is it possible to add this field on my printable ?

Thank you,

Nicolas

Like 0

Like

2 comments
Best reply

The issue is that the value has a 1:many relationship with the opportunity. The opportunity can have multiple products added, so which one would display? In this case, you should add this using "Set up report tables" which would result in a table or list of the products added to the opportunity.

Ryan

The issue is that the value has a 1:many relationship with the opportunity. The opportunity can have multiple products added, so which one would display? In this case, you should add this using "Set up report tables" which would result in a table or list of the products added to the opportunity.

Ryan

Thank you Ryan

it was exactly what i was looking for

Show all comments

Hi,

I am using the "Save Printable" business process element ('Save printable' process element | Creatio Marketplace) to create a printable and attach it to an Order as a PDF, but instead, it always creates a word document. Here is a video to show the issue: https://www.screenpresso.com/=q6LEd

 

The process runs with no errors, but instead of creating the PDF, it creates a Word doc.

 

Is there a missing parameter here or something that needs to be set to generate the document in the format needed?

 

Like 0

Like

4 comments
Best reply

I am not certain but there was an update from Creatio last year that removed the PDF function from Printables. Already existing Printables were still able to be converted to PDF, but new printables would not be able to. I am not sure if the Marketplace addon uses a distinct function to convert to PDF or uses what Creatio was using. I have used this element before and it worked but the Printable object may have been created before the Creatio patch that changed this function. 

I am not certain but there was an update from Creatio last year that removed the PDF function from Printables. Already existing Printables were still able to be converted to PDF, but new printables would not be able to. I am not sure if the Marketplace addon uses a distinct function to convert to PDF or uses what Creatio was using. I have used this element before and it worked but the Printable object may have been created before the Creatio patch that changed this function. 

Hello Rommel, Reid,

 

The “Save Printable” business process element uses the base functionality for generating printables.

Reid is absolutely right that Creatio products enable generating only the .docx files at the moment. The same refers to the add-on.

Hope this helps.

Have a good day!

Hello,

 

Any alternative to convert the word document to PDF or any fix to use the "Save Printable" business process element only for the conversion for the latest Creatio version?

Hello

We have released our Word to PDF converter addon in the marketplace: https://marketplace.creatio.com/app/experceo-word-pdf-converter-creatio

It allows you to convert unlimited Word documents to PDF without an external service.

I hope you find it useful!

Show all comments