Hello Creatio community,
We're trying to hide/show items in print section button based on specific conditions. The filter works fine in section page and edit page but it doesn't work when we try to open the edit page from the section page.
When we try to open the edit page from the section list the filter that we have made in both section and page doesn't apply and all the items in print button are displayed. Examples below.
1. Print button in section list
2. Print button when we open edit page (from reload)
3. Print button when edit page is open from application section list
Application page:
preparePrintFormsMenuCollection: function (printForms) {
this.callParent(arguments);
printForms.eachKey(function (key, item) {
if(key =="ebd9e198-9d05-21b7-6d30-4f79eb6cf2ea")
{
item.set("Visible", true);
}
else{
item.set("Visible", false);
}
}, this);
},
Application section:
isSectionPrintFormEnabled: function(reportId) {
if (!this.isAnySelected()) {
return false;
}
if (this.isSingleSelected() && !this.get("SelectAllMode")) {
var applicationId = this.$ActiveRow;
if(reportId == "ebd9e198-9d05-21b7-6d30-4f79eb6cf2ea"){
return true;
}
return false;
} else {
const reportCollection = this.get(this.moduleSectionPrintFormsCollectionName);
const report = reportCollection.get(reportId);
return (report && report.get("PrintFormType") !== Terrasoft.ConfigurationEnums.ReportType.Word) || !this.get("SelectAllMode");
}
},
The function "preparePrintFormsMenuCollection" is called every time the application page is opened. When the application page is opened from the section list (combined mode) the print button is not reloaded and keeps the older values.
How can we reload the items of the print button when the edit page is opened from section page?
Regards,
Lirzae