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

I have a record that I'm trying to delete, but just as the title says, the system is telling me that I do not have the rights to any CRUD operations despite me being the system user and making sure that I have full operation permissions on the object.

 

The specific object in question is the AppValidation object from the FinAppLending package. The record was created automatically by a business process. Is there something I'm missing that will allow me to do anything with this object?

 

Thanks in advance!

Like 0

Like

4 comments
Best reply

Hello,
 

Having verified all information, we inform you that in order to work with the Validation object, you must need the finserv lending creatio license, which grants you access to modify the Validation object.

So please check if you have this license.

Hello,

Do you have a license finserv lending creatio app assigned to your user?

Malika,

Yes, I have all available licenses in my system and I am marked as the system user, so I have full access permissions for everything already. 

Hello,
 

Having verified all information, we inform you that in order to work with the Validation object, you must need the finserv lending creatio license, which grants you access to modify the Validation object.

So please check if you have this license.

Malika,

 

Thank you for your help

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

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

Hello creatio community,

 

I have created a column into the object "RegDocumentType" named "Order". This object is used as a foreign key in "DocListInFinApp" which is displayed in "FinAppLendingPage" screen.

 

I want to apply a default sorting by RegDocumentType.Order in FinAppLendingPage as below:

"DocListInFinAppDetail": {
	"schemaName": "DocListInFinAppDetail",
	"filter": {
		"masterColumn": "Id",
		"detailColumn": "FinApplication"
	},
	"sortColumn": "Document",
	"sortColumnDirection": Terrasoft.OrderDirection.ASC,
	"sortColumnIndex": 0
},

 

The filter applied its working when I open the page. Do you have any suggestions on how to fix it?

Like 0

Like

1 comments

Hello,

 

In case you need to modify the default sorting you need to use the initQuerySorting method override (should be done in the detail schema and also replace the "UsrOrderColumn" with the column you need to use for sorting):

initQuerySorting: function(esq) {
                    const sortedColumn = esq.columns.find("UsrOrderColumn");
                    if (!sortedColumn) {
                        return;
                    }
                    sortedColumn.orderPosition = 0;
                    sortedColumn.orderDirection = Terrasoft.OrderDirection.DESC;
                },

Once saved you can refresh the page and the default sorting will be changed.

Show all comments

HI all,

I create custom sections from scratch and in section page my integration developments are working ok but in the customer Portal nothing triggered (Is not showing the option to RUN BP manually ) . It looks like is a permissions issue. I tried to activate some permissions but still not working (in console I have Error 403).

P.S. Please find attached images for more clarification.

Could you please help me to find the solution?

Thanks,

Like 0

Like

0 comments
Show all comments

Hello,

 

I am trying to add a new record in a detail inside to another one. The + button is missing even the object permission are configured for this role. (attach Creatio1.png)

 

When I change the detail with option "Make the list editable"  (attach Creatio2.png), the button is shown but the business rules and filters are not applied.  (attach Creatio3.png)

 

Any idea how to fix this issue?

Like 0

Like

4 comments
Best reply

Hello Denisa,

 

I would be happy to provide you with additional information regarding the database connections for the detail in question.

The detail must be connected to the SysModuleEntity record, which was added to the portal (SysModuleEntityInPortal table) to display for portal users.

Also, the detail must be connected to the SysModuleEntity record with no connection to the portal setting (SysModuleEntityInPortal table) to display for system users.



You have to create separate records  for details in the SysModuleEntity table:



1. The required connections for system users:

SysModuleEntity (Id column) - SysModuleEdit (SysModuleEntityId column).

2. The required connections for portal users :

SysModuleEntityInPortal (SysModuleEntityId column) - SysModuleEntity (Id column) - SysModuleEdit (SysModuleEntityId column).

 

By confirming the presence of these connections, you can ensure that the detail is properly configured to be displayed for both system users and portal users.

 

Best regards,

Kate

Hello!

 

It seems that you use the same detail for the main and portal page. To resolve the current issue, we recommend creating a separate detail for the portal page.

Here are the steps you can follow:

1) Go to the portal master wizard for your section.

2) Remove the existing detail from the portal edit page.

3) Create and add a new detail specifically designed for portal users in the detail section wizard, based on the existing object.

4) Add the new detail to the portal page.

5) Make sure to save the changes.

 

By creating a separate detail for the portal page, you can ensure that the issue you are experiencing is addressed and the users have the appropriate functionality.

 

Best regards,

Kate

Kate Karpik,

Hello Kate,

 

Thank you for your response. Your steps seems to be ok if the detail is related with section, because you have the possibility to have two section pages for full and portal and then relate full/portal detail schema in each page.

 

The issue I'm facing is with detail inside the detail. The system create only one page for the parent detail and if you have another detail inside the first one, even if you create two different details, the page of the parent detail is only one so the cardschema is the same for both full/portal of the child detail and the parent detail page is related only with one of them

Hello Denisa,

 

I would be happy to provide you with additional information regarding the database connections for the detail in question.

The detail must be connected to the SysModuleEntity record, which was added to the portal (SysModuleEntityInPortal table) to display for portal users.

Also, the detail must be connected to the SysModuleEntity record with no connection to the portal setting (SysModuleEntityInPortal table) to display for system users.



You have to create separate records  for details in the SysModuleEntity table:



1. The required connections for system users:

SysModuleEntity (Id column) - SysModuleEdit (SysModuleEntityId column).

2. The required connections for portal users :

SysModuleEntityInPortal (SysModuleEntityId column) - SysModuleEntity (Id column) - SysModuleEdit (SysModuleEntityId column).

 

By confirming the presence of these connections, you can ensure that the detail is properly configured to be displayed for both system users and portal users.

 

Best regards,

Kate

Kate Karpik,

 

Thanks for the detailed explanation, it worked out:)

 

The code in case that someone has the same issue:

-- 1. (Manual input) Change caption: with the caption of the new entity related with new detail
-- In my case the new object, the page and both details (full/portal) begin with ne same contain same caption. 
DECLARE @Caption as varchar(200) = 'Loan proposed terms and condition'
 
--2. (Manual input) Change Name: with the Name of the Parent Page of new detail 
DECLARE @CardSchemaUId uniqueidentifier = (
	SELECT	UId 
	FROM	SysSchema 
	WHERE	Name='FZSchema584f510ePage' 
)
-- 3. (Automatic) Get Uid of entityschema related to new detail
DECLARE @SysEntitySchemaUId uniqueidentifier = ( 
	SELECT	TOP 1 UId 
	FROM	dbo.SysSchema 
	WHERE	Caption like '%' + @Caption +'%' and ManagerName = 'EntitySchemaManager' 
)
 
-- 4. (Automatic) Insert if not exist on SysModuleEntityInPortal
INSERT INTO [dbo].[SysModuleEntityInPortal] ([Id], [CreatedOn], [CreatedById], [ModifiedOn], [ModifiedById], [ProcessListeners], [SysPortalId], [SysModuleEntityId])
SELECT	[Id] = NEWID(), [CreatedOn] = getDate(), [CreatedById]=CreatedById, [ModifiedOn] = getDate(), [ModifiedById]= CreatedById, [ProcessListeners]=0, 
		[SysPortalId] = 'C8565240-1DA3-4A68-BD4E-280F17B0D32E', [SysModuleEntityId] = SysModuleEntity.Id
FROM	(
			SELECT	id, [CreatedById], SysEntitySchemaUId
			FROM	dbo.SysModuleEntity
			WHERE	SysEntitySchemaUId = @SysEntitySchemaUId
		) SysModuleEntity		
		OUTER APPLY (
			SELECT	count (1) AS NR
			FROM	dbo.SysModuleEntityInPortal scp
					INNER JOIN dbo.SysModuleEntity sm ON scp.SysModuleEntityId = sm.Id
			WHERE	sm.SysEntitySchemaUId = @SysEntitySchemaUId
		) InSysPortal
WHERE	InSysPortal.NR IS NULL OR InSysPortal.NR = 0
 
-- 5. (Automatic) Insert if not exist on SysDetail
INSERT INTO [dbo].[SysDetail] ([Id], [CreatedOn], [CreatedById], [ModifiedOn], [ModifiedById], [ProcessListeners], [Caption], [DetailSchemaUId], [EntitySchemaUId])
SELECT	[Id] = NEWID(), [CreatedOn]= getDate(), [CreatedById], [ModifiedOn]= getDate(), [ModifiedById], [ProcessListeners], 
		[Caption] = SysSchema.Caption, [DetailSchemaUId] = SysSchema.Uid, [EntitySchemaUId] = @SysEntitySchemaUId
FROM	dbo.SysSchema 
WHERE	Caption like '%' + @Caption +'%' AND [Name] like '%Detail' AND ManagerName ='ClientUnitSchemaManager'
		AND Uid not in (Select [DetailSchemaUId] from SysDetail)
 
-- 6. (Automatic) Insert if not exist on SspPageDetail
INSERT INTO [dbo].[SspPageDetail] ([Id], [CreatedOn], [CreatedById], [ModifiedOn], [ModifiedById], [ProcessListeners], [CardSchemaUId], [EntitySchemaUId], [SysDetailId])
Select	[Id] = NEWID(), [CreatedOn]= getDate(), [CreatedById], [ModifiedOn]= getDate(), [ModifiedById], [ProcessListeners], 
		[CardSchemaUId] = @CardSchemaUId, [EntitySchemaUId] = SysDetail.EntitySchemaUId, [SysDetailId] = SysDetail.Id
FROM	SysDetail 
WHERE	EntitySchemaUId=@SysEntitySchemaUId and Caption like '%portal%'
		and Id not in ( Select SysDetailId FROM SspPageDetail )
 
-- 7. (Automatic) Insert if not exist on SysModuleEntity
INSERT INTO [dbo].[SysModuleEntity] ([Id], [CreatedOn], [CreatedById], [ModifiedOn], [ModifiedById], [TypeColumnUId], [ProcessListeners], [SysEntitySchemaUId])
SELECT	[Id] = NEWID(), [CreatedOn]= getDate(), [CreatedById], [ModifiedOn]= getDate(), [ModifiedById], [TypeColumnUId], [ProcessListeners], [SysEntitySchemaUId]
FROM	dbo.SysModuleEntity
WHERE	SysEntitySchemaUId = @SysEntitySchemaUId AND 
		(
			SELECT	count (1) 
			FROM	dbo.SysModuleEntity
			WHERE	SysEntitySchemaUId = @SysEntitySchemaUId
		) < 2
 
-- 8. (Automatic) Insert if not exist on SysModuleEdit also the new recored that was insertet on previos step
INSERT INTO [dbo].[SysModuleEdit] ([Id], [CreatedOn], [CreatedById], [ModifiedOn], [ModifiedById], [SysModuleEntityId], [TypeColumnValue], [UseModuleDetails], [Position], [HelpContextId], [ProcessListeners], [SysPageSchemaUId], [CardSchemaUId], [ActionKindCaption], [ActionKindName], [PageCaption], [MiniPageSchemaUId], [SearchRowSchemaUId], [MiniPageModes])
SELECT	TOP 1 [Id] = NEWID(), [CreatedOn] = getDate(), [CreatedById], [ModifiedOn] = getDate(), [ModifiedById], 
		[SysModuleEntityId] = new.SysModuleEntityId, [TypeColumnValue], [UseModuleDetails], [Position], [HelpContextId], [ProcessListeners]=0, [SysPageSchemaUId], [CardSchemaUId], [ActionKindCaption], [ActionKindName], [PageCaption], [MiniPageSchemaUId], [SearchRowSchemaUId], [MiniPageModes]
FROM	SysModuleEdit ref
		CROSS JOIN (
			SELECT	s.id as SysModuleEntityId
			FROM	SysModuleEntity s
					LEFT JOIN SysModuleEdit t On t.SysModuleEntityId = s.Id 
			WHERE	SysEntitySchemaUId = @SysEntitySchemaUId AND t.id IS NULL
		) new 
WHERE	ref.SysModuleEntityId in (
			SELECT	id
			FROM	dbo.SysModuleEntity
			WHERE	SysEntitySchemaUId = @SysEntitySchemaUId
		)

 

Show all comments

Hi Creatio!

I'm creating a Customer Portal and I am phasing an issue when I try to add DCM panel into page.

Cases workflow appear on the the section page :

But when I try to logg-in as user portal (role: All portal users) Cases workflow do not appear in the Customer Portal.



In the console log I receive "response status: 403 (SecurityException)".

Please what is your suggestion to fix this issue?

Thanks,

Like 2

Like

7 comments
Best reply

Hi all,

 

I want to share with you solution that Creatio support team helped me.

You have to check in object permissions if  "Portal Users" have permission to use  "SysDcmSettings" .

Hello Aurora,



Could you please let us know what portal license do you have on this local instance?



Also, could you please verify whether this DCM object is added to those lookups in order to be visible to portal users?

 

And one last question, does it appear on the portal the DCM for the cases section?

 

 

Hello,

I am having the same problem. I added the DCM object to both lookups, and I am also having an error in the console.



I check the DCM in the cases section, and I can see it.

Hello All!



Please check the following article for steps on how to add DCM to the portal: https://community.creatio.com/articles/enable-dcm-portal-users

 

In case you would still receive the error - please contact us on support@creatio.com

As I see it - this error is not the same for all and would require an individual approach.

 

Best Regards,

Dan

Bogdan,

Hello Bogdan,

The portal license that I am using in my local instance are as in the photo attached:

Is added object of Application Form (section) but not the case object (should be with the name "Application Form case in the Portal) :

Related to the last question DCM does not appear in the portal section (but as you can see to the image attached the section of the task appear but no the stages one).

Thanks,

Denis Bidukha,

Hi Denis, 

Images attached to the link are not clear.

And another question please , this solution is available for  the latest version of Creatio ?

(I am using Creatio  v8.0)

Thanks,

 

Aurora Leka,

 

 

Hi! The pictures are not representative anyway as they are made in Old UI. The information should be still relevant though. Please check if the specific portal user has required access rights and it the object has an "SSP available " checkbox checked.

 

If that did not help - please contact Support individually for investigation to be held

 

Best Regards,

Dan

Hi all,

 

I want to share with you solution that Creatio support team helped me.

You have to check in object permissions if  "Portal Users" have permission to use  "SysDcmSettings" .

Show all comments

Hello Creatio community,

 

I'm trying to debug a service deployed in another server. Which is the easiest way to debug a source code schema type? Currently I install all package updates and sometimes the database (to debug existing test cases) locally but this procedure is very time consuming.

 

Is there an easier way to debug a source code locally without the first procedure?

 

Regards,

Lirzae

Like 0

Like

1 comments

Hello,



Please find more infomation on server code debugging here.

 

Show all comments