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

3 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?

Show all comments