Hello Creatio Community,

I'm creating a script task for email sender using a documentation from creatio team. I followed the provided instructions for creating the script task, but when I published  the script task some errors occured.

Some of the classes and interface cannot be found also the IntegrationApi library cannot be found.

source code below :

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using Terrasoft.Common;
using Terrasoft.Core;
using Terrasoft.Core.Configuration;
using Terrasoft.Core.DB;
using Terrasoft.Core.Entities;
using Terrasoft.Core.Factories;
using Terrasoft.Core.Process;
using Terrasoft.Core.Process.Configuration;
using Terrasoft.Mail;
using Terrasoft.Mail.Sender;
using IntegrationApi;

    var mailBoxSettingId = Get("SenderMailbox");
    var emailClientFactory = ClassFactory.Get(
    new ConstructorArgument("userConnection", UserConnection));
    
    var emailSender = ClassFactory.Get(
    new ConstructorArgument("emailClientFactory", emailClientFactory),
    new ConstructorArgument("userConnection", UserConnection));
    var entity = UserConnection.EntitySchemaManager.GetInstanceByName("MailboxSyncSettings").CreateEntity(Uif (entity.FetchFromDB("Id", mailBoxSettingId, new List { "SenderEmailAddress" })) {
    var senderEmailAddress = entity.GetTypedColumnValue("SenderEmailAddress");
    var message = new Terrasoft.Mail.Sender.EmailMessage {
    From = senderEmailAddress,
    To = Get("Recipient").Split(';').ToList(),
    // Cc = List{ "first@recepient.co", "second@recepient.co"},
    // Bcc = List{ "first@recepient.co", "second@recepient.co"},
    Subject = Get("Subject"),
    Body = Get("Body"),
    Priority = Terrasoft.Mail.Sender.EmailPriority.Normal
    };
    var attachment = new Terrasoft.Mail.Sender.EmailAttachment {
    Id = Guid.NewGuid(),
    Name = "test.txt",
    Data = Encoding.ASCII.GetBytes("some test text")
    };
    message.Attachments.Add(attachment);
    emailSender.Send(message);
    }
    
    
    return true;


errors in lines :

    var emailClientFactory = ClassFactory.Get(
            var emailSender = ClassFactory.Get(
            var message = new Terrasoft.Mail.Sender.EmailMessage {
            Priority = Terrasoft.Mail.Sender.EmailPriority.Normal
            var attachment = new Terrasoft.Mail.Sender.EmailAttachment {

Documents in this link:
page 14: https://academy.creatio.com/docs/sites/academy_en/files/pdf/node/1474/Sending_emails_.pdf

https://academy.creatio.com/docs/7-18/developer/application_components/…



 

Like 0

Like

2 comments

Hello Alba,
Thanks for your question.

I am glad to assist you however it is hard to understand what causes the error without error messages. Could you please enable tracing for you business process and share the error message? 

This code works fine for me:
1

2

Hope this helps

Alba,

I had the same issue following the same article.

 

Then I decided to do differently. No code is needed :

 

 

By using the element process file you can generate the printable then using the file in the process allows you to add the file generated in the email as attachment, you don't need to store the file in an activity record.

 

Tell me if you need more details.

Show all comments

Hello Creation Community,

I have developed functionality that displays printables based on specific configurations. I have overridden the initCardPrintForms method and other necessary methods. However, I've encountered an issue: this development works correctly only when the page is rendered for the first time.
I need to refresh the list of printables whenever the "Product" field, used as a filter, is updated. Here's the relevant code snippet:

onProductUpdate: function(){
debugger;
this.setFZSelectedApp(this.$PrimaryColumnValue, true, null);
this.initCardPrintForms();
},
Even though the collection of printables updates during debugging, the action buttons, including the print button, do not reflect these changes.
Based on my developments the "Application form report" should be excluded after the product was updated.

Displaying image.png

Like 1

Like

1 comments

Hello,
Look at this discussion, I believe you can find useful information there.

Show all comments

Hi, 

I have a detail that uses an object  that represents structure of database view, the detail is non editable. 

What can I do that on double click of a row to open a page that contains the detail's columns as fields?

Like 0

Like

1 comments

Dear Alba,

 

You can register details based on a database view that will open to editing, the same way you can add a detail based on a regular object.

You can read more about these implementations in the following tree: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/detail-examples

 

Have a great day!

Show all comments

The records of associations in the MailboxFoldersCorrespondence and ActivityFolder tables exist, but when an email arrives, the Activity is not linked to the ActivityFolder, ActivityInFolder is empty. As a result, all emails are not associated with the folder on the mail server in which they are located.

How can I fix it?

 

Like 0

Like

1 comments

Dear Sergey,

 

Could you please provide us with an example and more details of this issue?

 

Thank you in advance!

Show all comments

Hi, all!

Is there any known way how to block update of main phone/email fields while adding new phone/email in Contact's communication options? 

 

I mean these fields are updated when one adds new record to comm options with types "phone" or "email" for Contact records and I would like to prevent such behaviour.

 

Is it possible to do that without writing a code?

Like 0

Like

3 comments

Hello,

 

We recommend you to try out this marketplace addon that allows you to manually mark any communication option as primary, which is not overridden by adding new options to the list:

https://marketplace.creatio.com/app/primary-communication-options-creat…

Mira Dmitruk,

Hello, could you please, clarify, if one installed that add-on, whether that option is available in import also? Or only for Contact form?

Artem Evdokimenko,

 

Yes, it is possible to mark the emails as primary with this addon when importing from excel, the column is "IsPrimary" and has values "yes" or "no". 

Show all comments

Hi,

In creatio, I have created a section which has a detail. The section's object has a field named 'Stage'. When 'Stage' value changes I want to refresh grid detail action buttons without page reloading, so that I can remove the + button (for adding) and the actions for copying, editing, deleting and Data Import.

I have tried using 'updateDetail' and 'reloadEntiy' but they don't seem to refresh these buttons

Like 0

Like

2 comments
Best reply

Hello,

 

Not sure about removing buttons (but theoretically it's possible using the "Visible" property), but as for the "Enabled" property, it's possible to control the state of the button. This can be achieved using sandbox messages exchange mechanisms like (control the copy button "Enabled" property in the detail on the case page based on the case category selected):

 

CasePage schema

messages: {
			"UpdateActionsStatuses": {
				mode: Terrasoft.MessageMode.PTP,
				direction: Terrasoft.MessageDirectionType.PUBLISH
			}
		},
		...
onCategoryChanged: function() {
				this.callParent(arguments);
				this.sandbox.publish("UpdateActionsStatuses", this.get("Category"), ["ForActionsStatusUpdate"]);
			}

 

Detail schema

messages: {
			"UpdateActionsStatuses": {
				mode: Terrasoft.MessageMode.PTP,
				direction: Terrasoft.MessageDirectionType.SUBSCRIBE
			}
		},
....
CopyRecordMenuItemEnabled: {
                    dataValueType: this.Terrasoft.DataValueType.BOOLEAN,
                    value: false
			},
....
getCopyRecordMenuItem: function() {
				return this.getButtonMenuItem({
					Caption: {"bindTo": "Resources.Strings.CopyMenuCaption"},
					Click: {"bindTo": "copyRecord"},
					Enabled: {bindTo: "CopyRecordMenuItemEnabled"},
					Visible: {bindTo: "IsEnabled"}
				});
			},
....
subscribeSandboxEvents: function() {
				this.callParent(arguments);
				this.sandbox.subscribe("UpdateActionsStatuses", this.updateActionsStatus, this,
						["ForActionsStatusUpdate"]);
			},
 
			updateActionsStatus: function(result) {
				var parentCaseCategory = result.displayValue;
				var isCategoryCorrect = parentCaseCategory == "PPE Case (Sales Contract)";
				this.updateCopyRecordMenuItem(isCategoryCorrect);
			},
 
			updateCopyRecordMenuItem: function(isCategoryCorrect) {
				var parentCopyRecordEnabled = this.getCopyRecordMenuEnabled();
				var isEnableCopyRecordMenuItem = isCategoryCorrect && parentCopyRecordEnabled;
				this.set("CopyRecordMenuItemEnabled", isEnableCopyRecordMenuItem);
			}

 

As a result the copy button will be enabled in the detail only if any record is selected in the detail and also if the case category (case page is where the detail is added) is "PPE Case (Sales Contract)".

Hello,

 

Not sure about removing buttons (but theoretically it's possible using the "Visible" property), but as for the "Enabled" property, it's possible to control the state of the button. This can be achieved using sandbox messages exchange mechanisms like (control the copy button "Enabled" property in the detail on the case page based on the case category selected):

 

CasePage schema

messages: {
			"UpdateActionsStatuses": {
				mode: Terrasoft.MessageMode.PTP,
				direction: Terrasoft.MessageDirectionType.PUBLISH
			}
		},
		...
onCategoryChanged: function() {
				this.callParent(arguments);
				this.sandbox.publish("UpdateActionsStatuses", this.get("Category"), ["ForActionsStatusUpdate"]);
			}

 

Detail schema

messages: {
			"UpdateActionsStatuses": {
				mode: Terrasoft.MessageMode.PTP,
				direction: Terrasoft.MessageDirectionType.SUBSCRIBE
			}
		},
....
CopyRecordMenuItemEnabled: {
                    dataValueType: this.Terrasoft.DataValueType.BOOLEAN,
                    value: false
			},
....
getCopyRecordMenuItem: function() {
				return this.getButtonMenuItem({
					Caption: {"bindTo": "Resources.Strings.CopyMenuCaption"},
					Click: {"bindTo": "copyRecord"},
					Enabled: {bindTo: "CopyRecordMenuItemEnabled"},
					Visible: {bindTo: "IsEnabled"}
				});
			},
....
subscribeSandboxEvents: function() {
				this.callParent(arguments);
				this.sandbox.subscribe("UpdateActionsStatuses", this.updateActionsStatus, this,
						["ForActionsStatusUpdate"]);
			},
 
			updateActionsStatus: function(result) {
				var parentCaseCategory = result.displayValue;
				var isCategoryCorrect = parentCaseCategory == "PPE Case (Sales Contract)";
				this.updateCopyRecordMenuItem(isCategoryCorrect);
			},
 
			updateCopyRecordMenuItem: function(isCategoryCorrect) {
				var parentCopyRecordEnabled = this.getCopyRecordMenuEnabled();
				var isEnableCopyRecordMenuItem = isCategoryCorrect && parentCopyRecordEnabled;
				this.set("CopyRecordMenuItemEnabled", isEnableCopyRecordMenuItem);
			}

 

As a result the copy button will be enabled in the detail only if any record is selected in the detail and also if the case category (case page is where the detail is added) is "PPE Case (Sales Contract)".

Yes, it worked. Thank you

Show all comments

Multi-line fields have a microphone icon - is this the built-in functionality of Creatio or is it the functionality of the browser?

Like 0

Like

6 comments

That is functionality of Creatio

1. What package is it in? 
2. Does this tool require updating or is it updated only by system update? 
3. How to enable or disable this functionality? 
4. 4. Is this functionality isolated and located only in the system itself or is it synchronized with an external source?
1. What package is it in? 
2. Does this tool require updating or is it updated only by system update? 
3. How to enable or disable this functionality? 
4. 4. Is this functionality isolated and located only in the system itself or is it synchronized with an external source?

Ryan Farley,

1. What package is it in? 
2. Does this tool require updating or is it updated only by system update? 
3. How to enable or disable this functionality? 
4. 4. Is this functionality isolated and located only in the system itself or is it synchronized with an external source?

Nikita,

Not sure what package this is in. It started as a devlabs marketplace addon. At that time the js files were bootstrapped from the Files node of the package (meaning you wouldn’t see it in the configuration for the package). I would assume it's now just part of the Terrasoft.controls.MemoEdit or Terrasoft.controls.BaseEdit controls.
As for disabling it, I typically hide it using CSS when needed. 

Ryan Farley,

Thank you :)

Show all comments

I know the Modified By field shows the last to modify a case.

I'm trying to find out how I can track users who may have modified a case multiple times.

 

If User A modifies a case, the User B modifies the same case, I want to be able to track (either exporting to excel or in a graph/dashboard) and record that User A did modify that case, even if User B was the last to do so.

 

Is this possible? Every combination I can come up with seems to only track the last to modify a case.

Like 0

Like

4 comments

You can set logging up on the object (and specific columns) under 'change log' although I am not sure how easy it is to export from there. Alternatively you could create a detail/section linked to Case (Case Audit) and have a business process that writes specific changes (like modified by) when a record is modified.

Hi Jason,

To track multiple modifications by different users in the "Case" section, enable the change log and add all the columns you need to monitor for modifications.

Rob Watson,

Thank you, I'm working with the logging now.

Goparna Nasina,

Thank you, working with the logging now.

Show all comments

I want to know my client secret in creatio studio's system settings, but it is encrypted how can I know what it is to integrate my application with creatio

Like 1

Like

1 comments

Hello!

You cannot decrypt the encrypted field. 
The data in the secret field is hidden because it contains confidential information for a specific system. 
You don't need the secret key from system settings to set up OAuth integration. Please follow the instructions provided to resolve the issue:
https://academy.creatio.com/docs/8.x/setup-and-administration/on-site-d…

Show all comments

Hello,

I have been asked to help with an environment built within the default package of "Custom."

It seems that the previous user did not create a new prefix or package to build out their new objects and fields but rather kept the default prefix of "Usr" and package of, "Custom."

 

As far as I know, they have kept all newly added elements in the environment without external factors for additional dependent packages.

I have attempted to transfer the elements in the configuration section and have accomplished that, but of course, I will run into compilation errors and dependency issues.

My end goal is to upload this project environment to the marketplace safely. So my question is this:

How can I safely transfer the elements of the default "Custom" Package to a new package that can ultimately be exported for the marketplace?

Thank you in advance for any help someone can provide.

Like 2

Like

1 comments

Hello,
 

By default, the "Custom" package is the highest in the package hierarchy and depends on all packages below it. If you want to transfer all schemas from the Custom package to another package, you need to make sure that the new package has dependencies on the required packages.
If the new package has the necessary dependencies, you will be able to successfully transfer the schemas and avoid compilation errors.
The problem is that such a package will likely have many dependencies on other packages (depending on which type of Creatio product it was developed on (for example, Studio has fewer packages, so there will be less dependencies on packages that may not be present in other Creatio environments)). If you want to publish this as an app on the Creatio Marketplace, we recommend following the guidelines described in the Creatio Academy article.
 

Thank you.

Show all comments