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

Hi community,

 

I was wondering if there was a way to add a "PRINT" button to a section which when clicked will export a whole tab (in this case the timeline tab) to PDF or directly print the whole timeline tab ?

 

I am pretty sure that it needs some coding to be done but in which way ?

Is it necessary to call some APIs via C# code ?

 

Many thanks for the help provided.

 

Best regards,

Jonathan

Like 1

Like

5 comments

Hi Jonathan,

 

The timeline tab displays information from connected entities (like activities or orders and so on). That's why this task can be completed without additional development by the correct specifying of the table part in the printable and exporting data needed.

Hi Oleg,

 

Thank you for the answer. I have searched a bit in the system but did not found how to achieve this.

 

Can you explain me a bit further "by the correct specifying of the table part in the printable and exporting data needed."

 

Many thanks,

Jonathan

Jonathan Quendoz,

 

there is no separate documentation on this matter since this functionality is similar to the details functionality on the page. You can setup table part in printalbes here:

Once you select adding a new record there you will see the page where you can select the object you are interested in and the connection setup between your master object (from which the print will be performed) and the target object (where connected data is located). In this example below:

my master entity is the "Contacts" section (since I create a Word report based on it) and the target entity is the "Activity" section. Once saved you can get the information on the "Subject", "Start" and "Due" columns of all activities connected to the contact from which the printable was generated and only activities where this contact is specified as "Owner" will be displayed. Additional filtration of activity records can be added to the "Table filters" tab (in the screenshot above).

 

In the report designer you can add this table part as in this example below:

As a result once you print data you will get this file:

Just perform a couple of tests using report tables and using them you will be able to get the same data that is located in the timeline.

Oleg Drobina,

 

When exporting the "Email" Activity type, how can I export the whole email text ? I have tried with the "body" column but it print the whole html body and not only the text.

 

In addition, how can I export all the activites from the timeline ? I have tried to implement it your way but id has printed only the last activity of the concerned contact.

 

Many thanks for the clarifications.

 

Best regards,

Jonathan

Jonathan Quendoz,

 

It should export all activities related to the contact, maybe the filtration or the connection was specified in the way that made the system to get only one activity instead of several activities. Maybe its because the contact you are interested in is not an owner or reported of missing activities, but is present as the activity participant in those activities.

 

As for the email - the body column in the object contains the HTML code as well (that is then displayed in the "Rich_text" column type so that's why you don't see HTML tags). In this case a custom macro should be created to process the subject column and remove HTML tags from it. For example you can create a custom macro as described here for the "Subject" column and inside this macro process the received HTML code using the code below (received from base method that is used in the incident registration from incoming emails where email body goes to the case description):

protected virtual string ClearHtmlText(string inputString) {
			var htmlWithoutImages = Regex.Replace(inputString, @"(<img\/?[^>]+>)", string.Empty, RegexOptions.IgnoreCase);
			var noCss = Regex.Replace(htmlWithoutImages, @"/\*.+?\*/", string.Empty, RegexOptions.Singleline);
			var noFormatting = Regex.Replace(noCss, @"/<!--[\s\S]*?-->/g", string.Empty, RegexOptions.IgnoreCase);
			var noStyle = Regex.Replace(noFormatting, "<style.*?</style>", string.Empty, RegexOptions.Singleline);
			var noScript = Regex.Replace(noStyle, "<script.*?</script>", string.Empty, RegexOptions.Singleline);
			var noHTML = noScript.Replace("\r\n</span>", " </span>");
			noHTML = noHTML.Replace("</span>\r\n", " </span>");
			noHTML = Regex.Replace(noHTML, @"<div>|<li>", "\r\n");
			noHTML = Regex.Replace(noHTML, @"\r\n{2,}", "\r\n");
			noHTML = Regex.Replace(noHTML, @"<[^>]+>|", string.Empty);
			noHTML = Regex.Replace(noHTML, "<.*?>", string.Empty);
			noHTML = HttpUtility.HtmlDecode(noHTML);
			noHTML = Regex.Replace(noHTML, @"^\s+$[\r\n]*", "\r\n", RegexOptions.Multiline);
			noHTML = Regex.Replace(noHTML, @"<base[^>]*>", string.Empty, RegexOptions.IgnoreCase);
			if (noHTML.StartsWith("\r\n")) {
				noHTML = noHTML.Substring(2, noHTML.Length - 2);
			}
			return noHTML;
		}

 

Show all comments

Hi,

 

I am trying to set up a print template for [Contact section]. 

One of the details I want to print out is the phone number which is listed in the field 'communication option' of [Contact section]

I am trying to find that info in 'set up report data' in the printables reports but can not see the data

 

Any one can help please

 

Thanks

Like 0

Like

1 comments
Best reply

Hello Minh,



Try do not to use the "contact communication option" object.

You can find the phone number directly in the contact object:





Best regards,

Bogdan

Hello Minh,



Try do not to use the "contact communication option" object.

You can find the phone number directly in the contact object:





Best regards,

Bogdan

Show all comments

Hello, 

We want to print html document in mobile app. we have HTML document (whole, with , , tags) in response after calling API.

Now we need to show print preview or something like it, to print on connected printer. No matter how, the main thing is to print it.

 

In web app, we made it using small js code. 

1. open new window

2. set html text

3. call print function

but this all are using browser's functionality.

 

How we can make it in mobile app?

Like 1

Like

4 comments

Dear Luka, 



Unfortunately, there are no known examples of adding printing functionality into Creatio mobile application. 

Please follow this link to learn more on development in Creatio Mobile Application in order to find the possible ways of implementing the mentioned functionality:

https://academy.creatio.com/documents/technic-sdkmob/7-16/creatio-devel…



Kind regards,

Roman Brown



 

I think, I explained incorrectly.

I need to invoke print preview, maybe it will platform native or something like it.

Can I create webview and set html to it? in both platforms?

It work, thanks

I have another problem now.

I need to print opened document, but there is error winPrint.print is not a function.

Can I somehow print opened page ?

Show all comments