Is it possible to generate a list of product in an offer by category and sum the total by category for example in an offer?

 

We have several products and would like to have a table with a service products'list and a total of services. Then a separate table with maintenance products'list that would be a yearly fee and a total of maintenance.

 

Thanks in advance

Like 0

Like

1 comments

Hi,

Such printable can be done. Products can be filtered in table of printables settings and total can be displayed via fields of printable setting. If an object which is used for printables is connected to the services by any field those services can be displayed in printable. 

Best regards,

Angela

Show all comments

Hi Community,

We are transferring changes from dev instance to prod instance through 'Export packages to archive' in configuration from dev and 'Installed Applications' on Prod. But we noticed one thing Printables and Email Templates were not transferred. Any idea how we can fix this issue?

Like 0

Like

1 comments

Hello Fulgen, 

 

Here is an example how to transfer the email template,

you shoukd just do it similarly:

1.For example I has first instance localhost:8001

I have created a template "Test" in lookup "Email templates" http://prntscr.com/n7t0if

2.Now the task is to correctly bind the template to the package EmailTemplatesTest

Binding can be added by pressing Add button http://prntscr.com/n7t2r5

3. Select object email message template and press OK http://prntscr.com/n7t5am

4. Setup the filter that will choose the correct records http://prntscr.com/n7t60h

For example, in my case, the record with specified Id will be bounded to the package http://prntscr.com/n7t6kd

(You can check what records meets the filter by pressing "Display data" button)

5. After template is binded, you should export package to the archive http://prntscr.com/n7t7sp



6. Install the package to another instance in installed applications section http://prntscr.com/n7tf5a 

7. Now the template is successfully transfered http://prntscr.com/n7thai 



FYI: If you will have problems with non english templates, try to bind to the package Email template localization object http://prntscr.com/n7t9es



Best regards,

Alex

Show all comments

Hi Community,

In printable, how can I change the value of boolean from true or false, display it on printable form as 'yes' or 'no' or check or uncheck

 

Like 0

Like

1 comments

Dear Fulgen,

You can do so by using macro: in list of fields setting you can set up each column (http://prntscr.com/n6qkdy).To change the form of a boolean value to checkbox use macros "ColumnName[#Boolean|CheckBox#]". For yes/no option use "ColumnName[#Boolean|Yes,No#]". This is how settings should look like: http://prntscr.com/n6qlil

Best regards,

Angela

Show all comments

Hi Community,

How can I dynamically replace the file name of the report generated in printable, lets say for example i want to put some transaction code or current date time it was generated.

Like 0

Like

4 comments

Dear Fulgen,

As for now this logic is not implemented in out-of-the-box version of the application and we do have a correspondent problem registered for our R&D team and it is in "Accepted" status.



You need to create a replacing schema for PrintReportUtilities and overwrite the current logic. This is the out of the box logic used for naming the file:

    getCaption: function() {

            var baseCaption = this.get("Caption") || this.get("NonLocalizedCaption");

            return baseCaption + ((this.get("ConvertInPDF") || this.isDevExpressReport()) ? ".pdf" : ".docx");

        },



Also you can use function downloadReport (in PrintReportUtilities object):

function downloadReport(caption, key) {

        var report = document.createElement("a");

        report.href = "../rest/ReportService/GetReportFile/" + key;

        report.download = caption;

        document.body.appendChild(report);

        report.click();

        document.body.removeChild(report);

    }

You can try adding this function to section edit page and develop additional logic for report generation.

Best regards,

Oscar

 

Oscar Dylan,

Hi Oscar Thanks for your reply, I tried to create a replacing client module for

PrintReportUtilities but there is a warning message "Substitution of modules is not allowed". Is it possible?

 

Oscar Dylan,

I also used this code on my edit page and changed the report.download to my file name but the file name is not replacing

function downloadReport(caption, key) {

        var report = document.createElement("a");

        report.href = "../rest/ReportService/GetReportFile/" + key;

        report.download = caption;

        document.body.appendChild(report);

        report.click();

        document.body.removeChild(report);

    }

 

Fulgen Ninofranco,

Try to find the answer in the article by the link below.

https://academy.bpmonline.com/documents/technic-sdk/7-13/client-modules

Show all comments

Hi Community,

I have a custom section, I added a custom button on edit view and button is visible on CRM and Customer portal as well.

On CRM that button is functional and on click the pdf is successfully downloading.

But on Customer portal that button is only visible and on click the pdf is not downloading.

from this post ( https://community.bpmonline.com/articles/how-show-printables-print-butt…) I come to know that I need to apply some permissions to enable OOB printable functionality for customer portal. I tried to apply all from this post but that button is still not functional and not downloading pdf (only button is appearing on edit view)

but since I'm not using OOB printable and I'm using custom button so may be there will be another solution to fix this issue like we need to add some code for enabling that button to download.

 

 

 

 

Like 0

Like

1 comments

Please deploy the application locally and debug the functionality. This way you'll find what exactly wrong. 

https://academy.bpmonline.com/documents/technic-sdk/7-13/server-code-de…

The main idea is that you need to give portal users access rights for all objects that you use in the printables. 

Show all comments

I try to run the script task in a business process to create a printable. If the business process is started by user, it'll work just fine, but when the process is started by another process or an event it'll break with an exception:

System.NullReferenceException: Object reference not set to an instance of an object.

   at Terrasoft.Configuration.ReportService.ReportService.GetSchemaNameByTemplateId(Guid templateId)

   at Terrasoft.Configuration.ReportService.ReportService.GenerateMSWordReport(String urlTemplateId, String urlRecordUId, Boolean convertInPDF)

   at Terrasoft.Core.Process.ProcessInvoiceAutoSendCustom1Custom21Custom2MethodsWrapper.ScriptTask2Execute(ProcessExecutingContext context)

   at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)

The script task is like this:

var PrintableId = Get<string>("PrintableId2");
var ObjectIdInvoice = Get<string>("ObjectIdInvoice1");
var ConvertToPdf = Get<bool>("ConvertToPdf");
var AddInvoiceId = Get<Guid>("AddInvoiceId");
var AttachmentType = Get<Guid>("AttachmentType");
 
var userConnection = Get<UserConnection>("UserConnection");
 
var reportService = new Terrasoft.Configuration.ReportService.ReportService();
Terrasoft.Configuration.ReportService.ReportData report = reportService.GenerateMSWordReport(
    PrintableId, ObjectIdInvoice, ConvertToPdf);
var entity = userConnection.EntitySchemaManager.GetInstanceByName("InvoiceFile");
var fileEntity = entity.CreateEntity(UserConnection);
fileEntity.SetDefColumnValues();
fileEntity.SetColumnValue("InvoiceId", AddInvoiceId);
fileEntity.SetColumnValue("TypeId", AttachmentType);
fileEntity.SetColumnValue("Name", "Invoice.pdf");
fileEntity.SetColumnValue("Data", report.Data);
fileEntity.Save();
return true;

I guess ReportService doesn't obtain UserConnection from Supervisor user, so it can't get instance of "InvoiceFile". Is that the case?

How to change the script to make ReportService work with Supervisor or maybe with UserConnection of another user?

Like 0

Like

3 comments

In a script task in an interpretive business process you need to get "user connection"  with the following syntax:

var userConnection = Get<UserConnection>("UserConnection");

Additionally, please note that if you want to work with process parameters in a script task, you need to write in the following manner:

var parameter1 = Get<Guid>("Parameter1");

Set("Parameter2", parameter1.ToString());

var parameter2 = Get<string>("Parameter2");



Also, from exception message it seems that desired template not exists in the system, so you should check it.

I have a similar requirement to send report automatically to users at a certain frequency. We use Creatio 7.18.5 and the report was built using the old ReportDesigner for 7.14 and was carried over to the new version when we upgraded. 

I tried to follow this article to create the report as part of our process - https://community.creatio.com/articles/generate-printable-and-send-it-attachment-email

When the process is manually run by the user, the report gets generated. But when scheduled to run by Supervisor using timer, it gives below error - 

Terrasoft.Core.InstanceActivationException: Error creating an instance of the "Terrasoft.Tools.DevExpressReport.IReportProvider" class ---&gt; Ninject.ActivationException: Error activating UserConnection using binding from UserConnection to method
Provider returned null.
Activation path:
  3) Injection of dependency UserConnection into parameter userConnection of constructor of type DevExpressConfReportLocalizationReader
  2) Injection of dependency IDevExpressReportLocalizationReader into parameter reportLocalizationReader of constructor of type ConfigurationDevExpressReportProvider
  1) Request for IReportProvider
 
Suggestions:
  1) Ensure that the provider handles creation requests properly.
 
   at Ninject.Activation.Context.ResolveInternal(Object scope)
   at Ninject.Activation.Context.Resolve()
   at Ninject.KernelBase.Resolve(IRequest request, Boolean handleMissingBindings)
   at Ninject.Planning.Targets.Target`1.ResolveWithin(IContext parent)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Ninject.Activation.Providers.StandardProvider.Create(IContext context)
   at Ninject.Activation.Context.ResolveInternal(Object scope)
   at Ninject.Activation.Context.Resolve()
   at Ninject.KernelBase.Resolve(IRequest request, Boolean handleMissingBindings)
   at Ninject.Planning.Targets.Target`1.ResolveWithin(IContext parent)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Ninject.Activation.Providers.StandardProvider.Create(IContext context)
   at Ninject.Activation.Context.ResolveInternal(Object scope)
   at Ninject.Activation.Context.Resolve()
   at Ninject.KernelBase.Resolve(IRequest request, Boolean handleMissingBindings)
   at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters)
   at Terrasoft.Core.Factories.ClassFactory.GetInstance[T](Func`1 action)
   --- End of inner exception stack trace ---
   at Terrasoft.Core.Factories.ClassFactory.GetInstance[T](Func`1 action)
   at Terrasoft.Configuration.DevExpressReportGenerator.Generate(UserConnection userConnection, ReportGeneratorConfiguration configuration)
   at Terrasoft.Core.Process.TAIAutoSendOrderLogSummaryMethodsWrapper.ScriptTask1Execute(ProcessExecutingContext context)
   at Terrasoft.Core.Process.ProcessScriptTask.InternalExecute(ProcessExecutingContext context)
   at Terrasoft.Core.Process.ProcessFlowElement.ExecuteItem(ProcessExecutingContext context)
   at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)

Below is the report generation part of the code -  

//ReportService reportService = new ReportService(userConnection);
//ReportData report = reportService.GenerateDevExpressReport(entitySchemaUId,reportSchemaUId,null,reportParamaters);
 
DevExpressReportGenerator reportGenerator = new DevExpressReportGenerator();
var configuration = new ReportGeneratorConfiguration {
				ReportTemplateId = !string.IsNullOrEmpty(reportSchemaUId) ? new Guid(reportSchemaUId) : Guid.Empty,
				EntitySchemaUId = !string.IsNullOrEmpty(entitySchemaUId) ? new Guid(entitySchemaUId) : Guid.Empty,
				RecordId = !string.IsNullOrEmpty(recordId) ? new Guid(recordId) : Guid.Empty,
				ReportParameters = !string.IsNullOrEmpty(reportParameters)
					? JsonConvert.DeserializeObject&lt;Dictionary&lt;string, object&gt;&gt;(reportParameters)
					: null
			};
ReportData report = reportGenerator.Generate(userConnection, configuration);

I understand it's an old version of the report but I would appreciate if anyone can provide any insights on what I'm missing.

Hello Nirupama, Can you check if the run elements in the background is disabled ? If that is enabled, then the process will not get the User Connection.

Show all comments

Hi Community,

Is it possible to rename the generated file from a printable?

My client wants a generated Quote doc file to be named using Number field instead of Quote#.doc (where # is the result of a counting).

Thanks.

Like 0

Like

3 comments

Dear Danilo,

The generated file name is the same as the name of the file which was uploaded to this printable record in the application. To rename the resulted file you need to rename a template and upload this new template to the printable record and after the next download it will be named as this template.

Best regards,

Oscar

 

Oscar Dylan,

Hi Oscar, thanks for your message.

I am actually refering to the generated file whom is attached to the object when selecting to Print it. For instance, the Quote object is currently generating files Quote1.doc , Quote2.doc on the Attachments and Notes tab. I would need it to be something like [Quote.NumberField]v1.doc. 

Is that possible? If so, how can I do this?

Thanks.

Hi guys, I found that the name I was looking for is being edited on the Save printable to quote Business Process. Thanks.

Show all comments

Hi Community,

Good Day

How can I  dynamically Hide/Unhide options under Print button based on some conditions (example based on value of some lookup field).

 

 

Like 1

Like

5 comments

Dear Fulgen,

In order to achieve such task you need to add custom code customization. Please see the instruction below, hope you will find it helpful. The realization should be added to the page schema.

1. Bind options' visibility on the virtual attribute. Set it to false by default:

"setFieldVisibility": {
    dataValueType: Terrasoft.DataValueType.BOOLEAN,
    type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
    value: false
}  

2. In onEntityInitialized method call your custom method, which will be setting the attribute value to true or false based on filed value:

onEntityInitialized: function() {
  this.callParent(arguments);
  this.setOptionsVisibility();
}

3. Add custom method to check the value of the filed on the page and set visibility based on it.

In order to change dynamically, please add another attribute on the page, where based on the particular field change the method is triggered and changing the visibility:

"OnLookUpChange":{
    "dependencies":[
        {
           "columns":["UsrLookup1"],
           "methodName":"setOptionsVisibility"
        }
      ]
}

Regards,

Anastasia

 

 

Fulgen,

There is a marketplace solution that might do what you're after: https://marketplace.bpmonline.com/app/printable-forms-filtering-bpmonli…

Anastasia Botezat,

Hi Anastasia, Thanks for your answer.



Now I can already handle event based on the value of lookup thru:

"OnLookUpChange":{
    "dependencies":[
        {
           "columns":["UsrLookup1"],
           "methodName":"setOptionsVisibility"
        }
      ]
}

But, now how can i get the id of each printables then set it to hidden/unhidden.

try this function to hide/unhide options by Id

 

            preparePrintFormsMenuCollection: function (printForms) {

                this.callParent(arguments);

                debugger;

    //    var stage = this.get("Stage");

        printForms.eachKey(function (key, item) {

            if(key !="c1af36b1-9550-46c4-8a2c-ff6450eed242".toLowerCase())

            {

                item.set("Visible", false);

            }

        }, this);

    }

 

put it in the method property 

Dear Fulgen,

Please use the code, which was provided by Mohamad. This is an overridden basic method for printable collection, which sets properties for button options. In order to check the Id of needed printables, you can right-click on the printable and inspect the item. Its Id will be indicated in the HTML id property.

In case you will have any further question, please let us know.

Regards,

Anastasia

Show all comments

Current template system works for simple cases. With anything more complex and involving data from not directly related entities I feel forced to create custom "bag of values" entities, just for the purpose of sending an email or generating a document. There's also no easy way to add arbitrary variables to templates. I mean variables that are not connected with any entities, something like for example current date. I think it would help a lot if you could set up multiple "macro sources" and add arbitrary parameters too (just like you can create parameters for a business process).

1 comments

Hello.

We will register the following idea for our R&D team in order to enhance the functionality for he upcoming releases.

Thank you for your ideas!

Best regards,

Matt

Show all comments

Hello, I need some help in printables . I want printable to be enabled based on Status . Example if status of selected record is Completed then printable must be enabled.

I have override  "isSectionPrintFormEnabled" method in my section page as i noticed it is the method which bind to enabled value in "initSectionPrintForms" method in PrintReportUtilities . It is not working as expected as printable is always showing as disabled.

Thank You.

Like 0

Like

3 comments

Dear Sushma,

Please find the example of button being enable in the Order section.

1. You need to override your section schema.  

2. Modify the diff of the button. Add "enabled" property to it. Bind it to your custom attribute. e.g.

{
	"operation": "merge",
	"parentName": "RightContainer",
	"propertyName": "items",
	"name": "PrintButton",
	"values": {
		itemType: Terrasoft.ViewItemType.BUTTON,
		"caption": {"bindTo": "Resources.Strings.PrintButtonCaption"},
		"classes": {"wrapperClass": ["actions-button-margin-right"]},
		"controlConfig": {"menu": {"items": {"bindTo": "CardPrintMenuItems"}}},
		"visible": {"bindTo": "IsCardPrintButtonVisible"},
		"enabled": {"bindTo": "IsPrintableEnabled"}
		}
}

3. Add the attribute, which default value is set to false. e.g.

"IsPrintableEnabled": {
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"dataValueType": Terrasoft.DataValueType.BOOLEAN,
	"value": false
}

4. Add custom method, which will set the attribute value to true after status check on initialising the page. e.g.

methods: {
	onEntityInitialized: function() {
		this.callParent(arguments);
		this.checkStatus();
	},
	checkStatus: function() {
		var status = this.get("Status").value;
		if (status !== "1f3ad326-effd-4ac3-a3e2-957e7def3684") {
		   this.set("IsPrintableEnabled", true);
	    }
    }
}

Hope you will find it helpful.

Regards,

Anastasia

Anastasia Botezat,

Thank you for reply, I implemented the example as you have suggested.

It seems that when I am opening the record from my section view, it is still displaying the PRINT button. However, once the record is open, when I reload the same page, it's disabling the button - as expected.



My reasoning is 'onEntityInitialized' method is not available in the section page to change the status of the "IsPrintableEnabled" attribute.

Dear Sushma,

in this case I would like to offer you to return to the approach overriding the PrintReportUtilities schema. Particularly draw your attention to getRowPrintButtonVisible method. It is responsible for displaying Print button in the rows, when clicking on records. As I understood this is of your interest. Please override this method to add status validation. The idea is that this method should return false in case status does not allow printables.

Also, you might be also interested in getCardPrintButtonVisible method responsible for the button in the section header.

Regards,

Anastasia

Show all comments