Hello creatio team, 

 

I have successfully set up the printables show/hide feature based on the value from field(Currency). But it only works when record is opened from section page or navigated from other page. It doesn't work if I refresh the record page. (I don't have any section printable so only focusing on edit page printables. )

 

 I have tried adding the preparePrintFormsMenuCollection() on the edit page and apply the filter there so it could work on refresh. But the value of the currency field coming as undefined so I can apply static filter and that worked on refresh but if I want to add condition based on currency to show and hide I can't do it.

 

 

My code on Edit page: 

 

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);

},

 

getPrintMenuItemVisible: function(reportId) {

var currentCurrency = this.get("UsrCurrency") || { displayValue: "" };

var        printMenuItems = this.get(this.moduleCardPrintFormsCollectionName),

item = printMenuItems.find(reportId);

 

if (Ext.isEmpty(item)) {

return false; // Ensure a boolean return

}        

                                 var caption = item.get("Caption") || "";

 

var isUsCurrency = currentCurrency.displayValue === "US";

 

var containsUs = caption.includes("-US");

 

return isUsCurrency === containsUs;

 

}, 

 

 

My code on section page: 

 

initQueryColumns: function(esq) {

this.callParent(arguments);

 

if (!esq.columns.contains("UsrCurrency")) {

esq.addColumn("UsrCurrency");

}

},

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);

},

getPrintMenuItemVisible: function(reportId) {

if (Ext.isEmpty(this.get("ActiveRow"))) return true;

 

var currentCurrency = this.get("GridData").get(this.get("ActiveRow")).get("UsrCurrency") || { displayValue: "" };

var        printMenuItems = this.get(this.moduleCardPrintFormsCollectionName);

var        item = printMenuItems.find(reportId);

 

if (Ext.isEmpty(item)) return;

var caption = item.get("Caption") || "";

 

var isUsCurrency = currentCurrency.displayValue === "US";

 

var containsUs = caption.includes("-US");

 

return isUsCurrency === containsUs;

},

 

 

 

I have tried adding in the  preparePrintFormsMenuCollection()

 

 

preparePrintFormsMenuCollection: function(printForms) {

printForms.eachKey(function (key, item) {

if (!item.get("Caption")) {

item.set("Caption", item.get("NonLocalizedCaption"));

}

item.set("Tag", key);

if (item.get("TypeColumnValue")) {

item.set("Visible", { bindTo: "getPrintMenuItemVisible" });

}

 

var currentCurrency = this.get("UsrCurrency");

console.log("## currentCurrency", currentCurrency);

 

    var caption = item.get("Caption") || "";

If(currentCurrency.displayValue === "US"){

item.set("Visible", caption.includes("-US"));

}

}, this);

}

Like 0

Like

6 comments

The reason why this happens is when you open a page from the section you are in combined mode and the logic for the print menu comes from the Section schema. When you refresh, the edit page only opens in edit mode, in this case the logic is coming from the Page schema (when you refresh, note that the tab on the left to popout the section list to navigate is no longer there). Basically, your logic needs to be implemented on both the section schema and also on the page schema to handle both cases. There are a few community posts on this that show both sides, perhaps this or this might help to piece together the details.

Ryan

Ryan Farley,

Hello Ryan, highly appreciate your response. As I have attached above, I have included the code on edit page as well. Seems like edit page code doesn't work. I have exactly similar code as your article but edit page code doesn't apply the filter. I see couple of person commented on below the article and they are facing the same issue. Did we find the work around yet?

 

Hello Creatio support do we have solution for this?

The problem here is that on Edit page initCardPrintForms method is called before onEntityInitialized so the field value is undefined because it hasn't been initialized yet. It's the known issue and we have already registered a request to our R&D team to address that.

Iryna Oriyenko,

Thank you for the response but isn't really there a way to reload or refresh the print records after the entity has been initialized? 

Tony Stark,

So for workaround, Can we create the new dropdown next to 'PRINT' button dropdown? 

 

Since we can't have dependent 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!

Show all comments

Hello creatio experts, 

 

I want to show/ hide printables based on currency field. If the currency is us then show the printable which names contains '-US' in them. I have tried follow this article but the field value is getting undefined as the time this function run entity might not be initialized. I mainly want to do this for edit page.  

 

My code: 

 

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);

},

 

getPrintMenuItemVisible: function(reportId) {

var type = this.get("UsrCurrency") || { displayValue: "" },

console.log("## UsrCurrency", UsrCurrency);

var printMenuItems = this.get(this.moduleCardPrintFormsCollectionName),

item = printMenuItems.find(reportId);

if (Ext.isEmpty(item)) {

return false; // Ensure a boolean return

}                                

                                 var caption = item.get("Caption") || "";

 

return type.displayValue === "US Dollar" ? caption.includes("-US") : true;

},

 

Alternatively, I have tried this but printforms and currency come undefined

 

 

        preparePrintFormsMenuCollection: function(printForms) {

           printForms.eachKey(function (key, item) {

               if (!item.get("Caption")) {

                   item.set("Caption", item.get("NonLocalizedCaption"));

               }

               item.set("Tag", key);

               if (item.get("TypeColumnValue")) {

                   item.set("Visible", { bindTo: "getPrintMenuItemVisible" });

               }

               var currentCurrency = this.get("UsrCurrency");

               console.log("## currentCurrency1", currentCurrency);

               var isCurrencyEmpty = Ext.isEmpty(currentCurrency);

               var currentCurrencyDisplayValue = isCurrencyEmpty ? "" : currentCurrency.displayValue || "";

               if (!isCurrencyEmpty && currentCurrencyDisplayValue=="US Dollar" && item.get("Caption").includes("-US")){

               item.set("Visible", true);

               }

               else {

               item.set("Visible", false);

               }

           

           }, this);

       },

 

We already have getModulePrintFormsESQ() on the edit page and if add filter there for currency it would hide the remaining printable in list but this function only responsible for creating query so this doesn't refresh the list of printables as value of currency is undefined at the first call.

Like 0

Like

3 comments

Hello Tony,

 

The logic of forming the list of reports that are displayed in the "Print" button added to the page is hardcoded in the _generateMenuItems method in the core Angular files of the app. It doesn't contain the "visible" property and selects printables for the current entity only once when the page is refreshed or the entity is opened and then forms an array of printables using filter.map chain and return this array for the button. And we cannot override the logic of the _generateMenuItems method.

 

So in order to hide printables you have to add the filters like that:


 

initCardPrintFormsEsqFilters: function(esq) {
	esq.filters.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.CONTAIN,
	"Caption",
	"testStringValue"));
}

 

The problem here is that initCardPrintFormsEsqFilters method is called before onEntityInitialized so the record fields are not initialized yet so their values are undefined.

 

Meanwhile we will create a request for our R&D team to implement the possibility of filtration button options using custom handlers and also possibility of filtration of printables list also using a custom handler.

 

Thank you for reporting this idea to us and helping us in making the app better!

Iryna Oriyenko,

Relying same text here for future refrences: 

 

Thank you for the response but isn't really there a way to reload or refresh the print records after the entity has been initialized? 

Currently the printables are selected only once when the page is refreshed or the entity is opened. Other changes that are made to printables later in the page life cycle (e.g. adding filters) will not have the effect and the printables list will remain the same as it was created during the initialization.

Show all comments

 

Hello Community,

 

I'm currently working on generating a printable report formatted as a table. I've successfully linked the detailed information to the main object report. However, I have a couple of questions:

  1. Do I need to use out-of-the-box columns to retrieve data, or can  the report just include custom fields?
  2. Most of my custom fields populate correctly, but I'm encountering an issue with the 'Supplier' column, which is a lookup linked to the Account section. I've verified the database to confirm the data is correct, so I'm puzzled about the problem here.

I'm including images of the report setup and output, along with the data that should appear in the printable version.

The main object in the report is "Purchase Approvals," and the supplier location can be either Local or Foreign.

 

.

 

Below is what the output should be like in the supplier name 

Like 0

Like

1 comments

Hi,
 

1. You can add any column to the report, both OOTB and custom.
 

2.1. We recommend that you try to re-add the table to the report and check the behavior again, perhaps the problem is in the incorrectly displayed table.
 

2.2 Check that there are no columns with the same titles in the table you are displaying, you may be displaying different columns.
 

If the problem is still present, we recommend contacting technical support, support@creatio.com.
 

I hope this helps to solve the problem.

Best regards,
Pavlo!

Show all comments

Report does not generate:
Ideas missing expenses data

Like 0

Like

3 comments

Here is a sucessfull report launch result:

As this shows, the field COmment and Expenses amount is showing a "Null" result.

Have to start over again, any modifications to the original report makes the latest version STOP. It will not RUN.

Show all comments

I am installing the Creatio Ms-word Plug-in. the creatio bpm tab will be visible on my MS Word. now my problem is when I try to connect the plug-in it will show a 'connection error' but I will provide the correct user name and Password.

 

Like 1

Like

2 comments

Hi,

 

Perhaps you are using incorrect login credentials for the Word plugin. Try using these credentials to perform a standard login on the website you specified in the plugin (screenshot attached).

Jamie Stuart,

Hello, 
The connection issues may be caused by incorrect plugin settings, network restrictions, or outdated software versions.


Preliminary Checks:
- Ensure that MS Word and Creatio are updated to the latest versions.
- Verify that the internet connection is stable.

Check Plugin Settings:
- Open MS Word.
- Navigate to the Creatio plugin settings.
- Ensure that the server URL and credentials are correctly entered.

Network Restrictions:
- Check if any firewall or antivirus software is blocking the connection.
- Add exceptions for MS Word and Creatio in the firewall/antivirus settings.

Reinstall Plugin:
- Uninstall the Creatio plugin from MS Word.
- Download the latest version of the plugin from the Creatio website.
- Install the plugin and configure the settings again.
 

Show all comments

I need to do a custom button implementation, which will download the grid from the detail with all the data that is in the grid, like the similar function of the "PRINT" button.

 

Like 0

Like

1 comments

Hi Gabriel Cassimiro,



Please feel to explore the printables in the below thread.

It is explained for Portal users and in the same way, functionality has to be implemented in your custom section (Please be informed to debug the modules explained in the article and use it accordingly for your functionality).



https://community.creatio.com/articles/how-show-printables-print-button-printables-portal-user

 

 

BR,

Bhoobalan Palanivelu.

Show all comments

Hi community,

I made one printable on contact section for downloading the Contact's reports.

I am able to select the single or multiple contact and  to download  reports on single  click.

But I want that the  file name should be the Contact's full name

So please help me to implement this solution 

 

Thanks in advanced

Like 2

Like

2 comments

Hello, 

 

As for now there is no option to change the file name dynamically or assign some particular name. We have this task registered in our backlog and waiting for this option to be available in future application versions.

 

I will assign your case to this project in order to increase its priority.

Best regards,

Anastasiia

Migel Stoddard,

 

At this moment, the functionality is not available yet. As I can see the idea was accepted, but the development process haven't started.

Show all comments

Hi Team,

 

I was implementing a print report on a section. Now, I want to download the report in (ColumnName).docx in which ColumnName varies for each record based on the data stored in that column. By default, it is giving the same name as the printable name for all the records. Please help

Like 1

Like

1 comments

Hello, 

 

As for now there is no option to change the file name dynamically or assign some particular name. We have this task registered in our backlog and waiting for this option to be available in future application versions.

 

I will assign your case to this project in order to increase its priority.

Best regards,

Anastasiia

Show all comments

Hi;

I generate printables for some entities

I now how to customize the name saving in entityFile table but is it the way to change dynamically name of word document downloaded from the print button



Regards



Tomek

Like 0

Like

3 comments

Hello Tomasz,

There is a marketplace add-on that does this if you're interested. See https://marketplace.creatio.com/app/custom-names-reports-creatio

Ryan

Ryan Farley,

Thank You

Hi Ryan,

 

The link you've provided seems to be unavailable. Could you please help in generating a customized name for printable.

 

Best Regards,

Sarika

Show all comments

Hi Team,

 

I have a requirement to get data of details attached with a record into fast report designer to generate PDF.

we referred academy but data only from the section was fetched can some please help me to achieve this functionality any other workaround will appreciated.

https://academy.creatio.com/documents/technic-sdk/7-15/setting-reports-…

 

Above article that I used to achieve this funtionality

 

Thank you

Like 1

Like

3 comments

Hello,

 

I've attached the example of provider schema as a .md file as well as the raw text file with code and report template. In the example the report takes ContactAnniversary detail in Contacts. Here is the report setup:

 

http://ftp.creatio.com/support/downloads/SR-0937017/Files.rar

{
    "ProviderName": "ContactAnniversariesReportDataProvider",
    "Schemas": {
        "Contact": {
            "Id": {
                "DataValueType": 0
            },
            "Name": {
                "DataValueType": 1
            },
            "Phone": {
                "DataValueType": 1
            },
            "HomePhone": {
                "DataValueType": 1
            },
            "MobilePhone": {
                "DataValueType": 1
            },
            "OwnerName": {
                "DataValueType": 1
            }
        },
        "ContactAnniversary": {
            "ContactId": {
                "DataValueType": 10,
                "ReferenceSchemaName": "Contact",
                "ReferenceColumnName": "Id"
            },
            "TypeName": {
                "DataValueType": 1
            },
            "Date": {
                "DataValueType": 8
            }
        }
    }
}

 

Best regards,

Oscar

Hi Oscar, I cannot import the md file, I'm getting an error regarding the package: "Unable to save changes for item "Custom". It is either created by third-party publisher or installed from the file archive", how can I import it?

Julio.Falcon_Nodos,

Hello,

 

It's because starting from 7.16.1 this schema was added out-of-the-box and can be found in the "FastReport" package:

So that's why there is no need to add this schema to the system anymore.

 

Best regards,

Oscar

Show all comments