Hi All, 

I have a requirement to restrict the user from uploading or deleting attachments once a particular date is reached. I have tried to remove access rights for attachment object in a business process but still the user is able to upload attachments.

Like 1

Like

3 comments

Hello Balaka,

 

could you please let us know where exactly are you trying to prevent the user from uploading/deleting attachments?

 

Thank you.

Hi,

 

You can create a sub-process on the correspondent object to restrict adding new records or deleting records based on some conditions. For example here is the code I created for the AccountFile records:

 

1) Created a sub-process:

2) Specified the following code in the "Methods" tab of the subprocess:

namespace Terrasoft.Configuration
{
 
	using DataContract = Terrasoft.Nui.ServiceModel.DataContract;
	using Newtonsoft.Json;
	using Newtonsoft.Json.Linq;
	using System;
	using System.Collections.Generic;
	using System.Collections.ObjectModel;
	using System.Data;
	using System.Drawing;
	using System.Globalization;
	using System.IO;
	using System.Linq;
	using Terrasoft.Common;
	using Terrasoft.Common.Json;
	using Terrasoft.Configuration;
	using Terrasoft.Core;
	using Terrasoft.Core.Configuration;
	using Terrasoft.Core.DB;
	using Terrasoft.Core.DcmProcess;
	using Terrasoft.Core.Entities;
	using Terrasoft.Core.Factories;
	using Terrasoft.Core.Process;
	using Terrasoft.Core.Process.Configuration;
	using Terrasoft.GlobalSearch.Indexing;
	using Terrasoft.UI.WebControls.Controls;
	using Terrasoft.UI.WebControls.Utilities.Json.Converters;
 
	#region Class: AccountFile_CustomEventsProcess
 
	public partial class AccountFile_CustomEventsProcess<TEntity>
	{
 
		#region Methods: Public
 
		public override void OnFileSaving()
		{
 
			DateTime currentDateTime = DateTime.Now;
			var accountId = Entity.GetTypedColumnValue<Guid>("AccountId");
			var accountResultESQ = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "Account");
			accountResultESQ.UseAdminRights = true;
			accountResultESQ.AddColumn("Id");
			accountResultESQ.AddColumn("UsrRestrictUploadDateTime");
			accountResultESQ.CreateFilterWithParameters(FilterComparisonType.Equal, "Id", accountId);
			var accountResult = accountResultESQ.GetEntityCollection(UserConnection);
			var connectedAccountData = accountResult[0];
			connectedAccountData.UseAdminRights = true;
			DateTime restrictDateTime = connectedAccountData.GetTypedColumnValue<DateTime>("UsrRestrictUploadDateTime");
			int comparisonResult = DateTime.Compare(currentDateTime, restrictDateTime);
			if (comparisonResult < 0)
			{
				base.OnFileSaving();
			}
			else
			{
				throw new Exception("Restricted!");
			}
		}
 
		public virtual void OnFileDeleting()
		{
			DateTime currentDateTime = DateTime.Now;
			var accountId = Entity.GetTypedColumnValue<Guid>("AccountId");
			var accountResultESQ = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "Account");
			accountResultESQ.UseAdminRights = true;
			accountResultESQ.AddColumn("Id");
			accountResultESQ.AddColumn("UsrRestrictUploadDateTime");
			accountResultESQ.CreateFilterWithParameters(FilterComparisonType.Equal, "Id", accountId);
			var accountResult = accountResultESQ.GetEntityCollection(UserConnection);
			var connectedAccountData = accountResult[0];
			connectedAccountData.UseAdminRights = true;
			DateTime restrictDateTime = connectedAccountData.GetTypedColumnValue<DateTime>("UsrRestrictUploadDateTime");
			int comparisonResult = DateTime.Compare(currentDateTime, restrictDateTime);
			if (comparisonResult < 0)
			{
				base.DeleteFileUsingFileApi();
			}
			else
			{
				throw new Exception("Restricted!");
			}
		} 
 
		#endregion
 
	}
 
	#endregion
 
}

The logic in the code will compare the date\time value specified in the UsrRestrictUploadDateTime column of the main account record where the "Account attachments" detail is located, and it the current date and time is greater than the UsrRestrictUploadDateTime column value then the save and delete will fail:

As for deleting the file: custom exception doesn't work here and the standard message is returned:

Didn't figure out why, but it won't let deleting a record anyway. Also if this logic should be applied to specific users then you will also need to create an additional logic of checking if the current user (information on the user can be received from UserConnection) can or cannot add\delete files.

 

Hope it helps.

 

Best regards,

Oscar

Oleg Drobina,

 

Hi Oscar,

 

Have you found any solution? on custom, the exception doesn't work on the deletion scenario above and the standard message is returned.

Let me know if you have any solutions.

 

Regards.

Show all comments

Hi Team

 

I'm looking for some functionality where the user gets a message sent by other user of a different role displayed as soon as he logs in to creatio system .

Also there should be complete privacy for the communication so that the two users of a common role can not see the chats of each other.

 

Please suggest some ways through which this can be achieved except for Whatsapp, Telegram and Facebook as we do not want any third party app involved in this.

 

Like 1

Like

4 comments

Hi Sarika,

 

I am sure your requirement can be fully covered using the standard Feed section where channels for posting can be created and followers can be selected:

As a result new feed messages will be displayed in the CTI panel and also in the feed section.

 

Best regards,

Oscar

Hi Oscar, 

 

Thanks for the reply.

 

This seems to be a helpful option in our case. 

 

Just request you to provide the additional information for how can we add multiple feed channels in a section or some sort of functionality where user can select the channel in which he/she wants to post?

 

Best regards,

 

Sarika

Hi,

 

I have found the option where user can select the channel but here the user - JICO is able to see the other channels list also in which he is not added(He is not added in the channels GC-CCR and GC-AXA).

 

1.How can I filter out the list of channels based on the user that is allowed to post in that channel?

 

Please Refer to the Screenshot.

 

 

 

2. How can user select the channel from the feed that is specific to each section record in the section itself? For example, how the user JICO posts in the feed after selecting the channel so that this post is specific to a section record.

 

Kindly help.

 

 

 

Best Regards,

 

Sarika

 

 

Sarika Sharma,

 

1) You need to administrate channels by records and specify correspondent record permissions to these channels

 

2) There is no way to select channels in the feed of the record page, this option is available in the Feed module in the CTI panel or in the Feed section directly.

 

Best regards,

Oscar

Show all comments

How to sort the New button with multiple cases in section page.Like section page having multiple case pages, need to sort them based on the name field.

 

 

File attachments
Like 0

Like

1 comments

Hello,

 

It's possible, the logic of the "converter" function of the "bindConfig" object of the "SeparateModeAddRecordButton" element of the BaseDataView should be modified:

 

The list of pages is returned in an "items" array of the editPages collection:

 

For example in my CaseSection section elements will be loaded in the following manner:



1) "Incident"

2) "Service request"

3) "Test cat 2"

4) "Test cat 1"



Because this is the set that is returned:

 

 

And indeed when the method ends its execution we can see that the list is loaded in the manner specified in the debugger:

You can override the method execution. In my example I've added this code to the CaseSection (in your case it should be AccountSectionV2) to the diff array of the schema and added additional logic to the method of logging the "Hello" word in the console when the method is executed:



{

                "operation": "merge",

                "name": "SeparateModeAddRecordButton",

                "propertyName": "items",

                "values": {

                    "itemType": Terrasoft.ViewItemType.BUTTON,

                    "style": Terrasoft.controls.ButtonEnums.style.GREEN,

                    "caption": {"bindTo": "AddRecordButtonCaption"},

                    "click": {"bindTo": "addRecord"},

                    "visible": {"bindTo": "IsAddRecordButtonVisible"},

                    "classes": {

                        "textClass": ["actions-button-margin-right"],

                        "wrapperClass": ["actions-button-margin-right"]

                    },

                    "controlConfig": {

                        "menu": {

                            "items": {

                                "bindTo": "EditPages",

                                "bindConfig": {

                                    "converter": function(editPages) {

                                        if (editPages.getCount() > 1) {

                                            this.console.log("Hello:)");

                                            return editPages;

                                        } else {

                                            return null;

                                        }

                                    }

                                }

                            }

                        }

                    }

                }

            }

and it worked perfectly:

 

 

So what is needed to be done is to sort the items array inside of the editPages.collection object. This is more JS-side task rather than development on the Creatio platform so you will need to perform this sorting on your side.



Best regards,

Bogdan

Show all comments

Hi All,

 

I am trying to lock all the fields on a page. So I have followed the following article:

"https://academy.creatio.com/docs/developer/interface_elements/interface_control_tools/locking_edit_page_fields/overview"

I have set the value of IsModelItemsEnabled to false in methods of the edit page in following ways,

  1. setCardLockoutStatus: function() {

                    this.set("IsModelItemsEnabled", false);

                },
  2. onEntityInitialized: function(){

                    this.callParent(arguments);

                    this.set("IsModelItemsEnabled", false);

                },

But still all the fields are editable. Can anyone suggest what am I doing wrong?

Like 0

Like

2 comments
Best reply

Hi,

 

Tested on the AccountPageV2 schema and it worked properly:

 

1) Enable the feature via the database:

DECLARE @allEmpoyeeGroupName nvarchar(max) = 'All employees';
DECLARE @featureName nvarchar(max) = 'CompleteCardLockout'
DECLARE @featureStatus bit = 1;
 
IF (NOT EXISTS (SELECT NULL FROM Feature WHERE Code = @featureName))
BEGIN
  INSERT INTO Feature (Name, Description, Code, ProcessListeners) 
  VALUES (@featureName, @featureName, @featureName, 0)
END
IF(EXISTS (SELECT NULL FROM AdminUnitFeatureState 
         WHERE FeatureId = (SELECT Id FROM Feature WHERE Code = @featureName) AND
           SysAdminUnitId = (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName)) )
BEGIN
  UPDATE AdminUnitFeatureState SET FeatureState = @featureStatus WHERE FeatureId = (SELECT Id FROM Feature WHERE Code = @featureName) AND
                              SysAdminUnitId = (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName)
END
ELSE
BEGIN
  INSERT INTO AdminUnitFeatureState (ProcessListeners, SysAdminUnitId, FeatureState, FeatureId) VALUES 
                    (
                    0,
                    (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName),
                    @featureStatus, 
                    (SELECT Id FROM Feature WHERE Code = @featureName)
                     )
END

2) In the AccountPageV2 added the following code to the diff array:

{
				"operation": "merge",
				"name": "CardContentWrapper",
				"values": {
					"generator": "DisableControlsGenerator.generatePartial"
				}
			},

3) In the AccountPageV2 added the following attribute:

"IsModelItemsEnabled": {
				dataValueType: Terrasoft.DataValueType.BOOLEAN,
				value: false
			},

4) Relogin to the app

5) Open account edit page

6) All the fields are locked

 

Best regards,

Oscar

Hi,

 

Tested on the AccountPageV2 schema and it worked properly:

 

1) Enable the feature via the database:

DECLARE @allEmpoyeeGroupName nvarchar(max) = 'All employees';
DECLARE @featureName nvarchar(max) = 'CompleteCardLockout'
DECLARE @featureStatus bit = 1;
 
IF (NOT EXISTS (SELECT NULL FROM Feature WHERE Code = @featureName))
BEGIN
  INSERT INTO Feature (Name, Description, Code, ProcessListeners) 
  VALUES (@featureName, @featureName, @featureName, 0)
END
IF(EXISTS (SELECT NULL FROM AdminUnitFeatureState 
         WHERE FeatureId = (SELECT Id FROM Feature WHERE Code = @featureName) AND
           SysAdminUnitId = (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName)) )
BEGIN
  UPDATE AdminUnitFeatureState SET FeatureState = @featureStatus WHERE FeatureId = (SELECT Id FROM Feature WHERE Code = @featureName) AND
                              SysAdminUnitId = (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName)
END
ELSE
BEGIN
  INSERT INTO AdminUnitFeatureState (ProcessListeners, SysAdminUnitId, FeatureState, FeatureId) VALUES 
                    (
                    0,
                    (SELECT Id FROM SysAdminUnit WHERE Name = @allEmpoyeeGroupName),
                    @featureStatus, 
                    (SELECT Id FROM Feature WHERE Code = @featureName)
                     )
END

2) In the AccountPageV2 added the following code to the diff array:

{
				"operation": "merge",
				"name": "CardContentWrapper",
				"values": {
					"generator": "DisableControlsGenerator.generatePartial"
				}
			},

3) In the AccountPageV2 added the following attribute:

"IsModelItemsEnabled": {
				dataValueType: Terrasoft.DataValueType.BOOLEAN,
				value: false
			},

4) Relogin to the app

5) Open account edit page

6) All the fields are locked

 

Best regards,

Oscar

Oscar Dylan,

 

I have tried this and able achieve my objective. Apparently what I was missing was, I have not added the code in diff array. Thank you so much for your time & effort.

 

Regards,

Sourav Kumar Samal

Show all comments

Dear Team,

We are facing an issue with the access rights for the records in the contact and account. By default, in the object permission for the contact and account, all the access are provided to the system admin and all employees and later had added the portal user in the operational permission and along with few organization roles and had provided the access as shown in the attached screenshot [Object_Permission.png] for both contact and account 

 

 As the portal user was not able to view the record even though the access was provided, we did disable the use operation permission and updated the record permission by doing that all the access for the record was removed. 

 

Later, again we enabled the use operation permission and updated the record permission, but the access wasn’t provided to the records which was removed from the previous step [Record.png]

 

There are more than 1 Lakh record in both the section, how can we provide back the access to all the records from the object permission?

Like 1

Like

1 comments

Hello Amritha,

 

We already have a support ticket regarding this issue.

Please refer to your case regarding this issue.

 

Thank you,

Artem.

Show all comments

Hi community.

I need to connect an activity to an activity.

Out-of the box this feature is not available.

Checking on the Activity entity I saw the field ActivityConnection which is a lookup field on Activity.

This field is not inserted on Activity page.

Is it deprecated ?

Can I use it to link one activity to another activity ?

Like 0

Like

6 comments

Hello Stefano,

 

Unfortunately, we don't have such implemented results. 



You can create a new lookup column and bind it according to this post, and customize it according to your business task:

https://community.creatio.com/questions/connect-activity-custom-object#…

 

Best regards,

Bogdan

Bogdan,

Hi Bogdan 

thank you for your answer

So, if I understand the field "AcitvityConnection" is deprecated.

Is it correct ?

Stefano Bassoli,

 

It is not a column, it is a separate table:

 

Regards,

Bogdan

Bogdan,

Hi Bogdan

I'm referring to the Activity.ActivityConnection lookup field available on Activity entity.

Stefano Bassoli,

Hi Stefano,

 

have you found out if this field is supposed to be deprecated?

 

I just found out that it is still being used in the functionality for linking emails from the mailbox to other object, namely in the method loadEntityConnectionColumns in the EntityConnectionLinksUtilities mixin.

It made some problems when we tried to reuse this field, so I suggest not to tinker with it too much and simply create a new one.

 

Regards,

Robert

Robert Pordes,

Hi Robert,

I created a new custom field, just in case. 

Show all comments

I am using the BaseEntityEventListener.OnSaving method where in addition to saving the entity I want to call an asynchronous method. Is there any way I can convert OnSaving to asynchronous?

Like 0

Like

1 comments

Hello,



Unfortunately, it could be achieved only via Asynchronous operations in the Entity event layer described by the link below:

https://academy.creatio.com/docs/developer/back_end_development/objects…

 

Best regards,

Bogdan

Show all comments

Hello community,



After successfully importing my custom package from file system, I tried to compile it and I got the following error:

 

After checking the Build.log I found the following error:

2022-02-01 03:44:23,013 [122] INFO IIS APPPOOL\Creatio Build BuildConfigurationProjects - WorkspaceCompiler.Build started at 00:00:09.0206194

2022-02-01 03:44:23,013 [122] INFO IIS APPPOOL\Creatio Build SetCustomProperties - UseSourceCodeSchemaGenerator = True

2022-02-01 03:44:23,013 [122] INFO IIS APPPOOL\Creatio Build SetCustomProperties - OldUI = False

2022-02-01 03:44:23,013 [122] INFO IIS APPPOOL\Creatio Build SetCustomProperties - NetStandardCompatibilityMode = True

2022-02-01 03:44:23,653 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput - Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core

2022-02-01 03:44:23,653 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput - Copyright (C) Microsoft Corporation. All rights reserved.

2022-02-01 03:44:24,325 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput -   Determining projects to restore...

2022-02-01 03:45:00,886 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput - C:\Program Files\dotnet\sdk\3.1.301\NuGet.targets(128,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\inetpub\wwwroot\Creatio\Terrasoft.WebApp\Terrasoft.Configuration\Pkg\FzLoanOriginationIntegration\Files\FzLoanOriginationIntegration.csproj]

2022-02-01 03:45:00,886 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput - C:\Program Files\dotnet\sdk\3.1.301\NuGet.targets(128,5): error :   No such host is known. [C:\inetpub\wwwroot\Creatio\Terrasoft.WebApp\Terrasoft.Configuration\Pkg\FzLoanOriginationIntegration\Files\FzLoanOriginationIntegration.csproj]

2022-02-01 03:45:00,917 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput - Build FAILED.

2022-02-01 03:45:00,917 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput - C:\Program Files\dotnet\sdk\3.1.301\NuGet.targets(128,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\inetpub\wwwroot\Creatio\Terrasoft.WebApp\Terrasoft.Configuration\Pkg\FzLoanOriginationIntegration\Files\FzLoanOriginationIntegration.csproj]

2022-02-01 03:45:00,933 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput - C:\Program Files\dotnet\sdk\3.1.301\NuGet.targets(128,5): error :   No such host is known. [C:\inetpub\wwwroot\Creatio\Terrasoft.WebApp\Terrasoft.Configuration\Pkg\FzLoanOriginationIntegration\Files\FzLoanOriginationIntegration.csproj]

2022-02-01 03:45:00,933 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput -     0 Warning(s)

2022-02-01 03:45:00,933 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput -     1 Error(s)

2022-02-01 03:45:00,933 [8] INFO IIS APPPOOL\Creatio Build CaptureOutput - Time Elapsed 00:00:37.16

 

Can someone explain why is this error happening, because I am not using any nuget library on my package and it is .Net framework version not .Net core. 

 

Thank you

Like 0

Like

2 comments

Hi Erald, 

this problems happens because .net Core SDK 2.2 is not installed in the server. Please try downloading it from here (please note that you don't need to delete the .net Core SDK 3.1 which is already installed) https://dotnet.microsoft.com/en-us/download/dotnet/2.2 and let us know if the problem persists. Once installed please restart the server and try compiling the app again.

developer,

 

We see that you have created a separate post (https://community.creatio.com/questions/problem-while-compiling-packages) and provided more details in it, we will work on your question there.

Show all comments

Hello community,

I'm working on an assembly package and I'm currently using OData3 for some integrations. I noticed that the end-point "/0/ServiceModel/EntityDataService.svc/" is not exposing the methods of the custom entities. Do you have any ideas to solve this problem?

Let me know.

 

Thanks in advance,

Luca

Like 0

Like

3 comments

Hello Luca,

 

I am not sure I understand you correctly. Can you please send an expected result and an actual result you receive?

 

Thank you!

 

Best regards,

Oscar

Hi Oscar Dylan,

I have a visual studio C# project binded to OdataV3 endpoint ("/0/ServiceModel/EntityDataService.svc/") and I don't find the custom entities created by me.

 

Using the following URL: "http://localhost/0/odata/$metadata" (ODataV4) I can see the expected entities.

 

The problem is that if I try to generate ODataV4 client code using "Unchase OData Connected Service" add-On it returns this error when I use ODataV4 endpoint.

 

While if I use ODataV3 endpoint with "Unchase OData Connected Service" add-On everything runs fine but the custom entities are missing (first picture). Furthermore if I use ODataV3 in a simple package every custom entity endpoint is available.

 

Did I make myself clear?

Thanks,

Luca

Luca Tavasanis,

 

Yes, it's clear now, thank you!

 

The problem is that OData3 forms its metadata based on the default assembly and doesn't include separate assemblies (where your objects are located), while OData4 uses a separate special assembly (neither default nor the custom one). And that's why its impossible to get access objects in packages compiled in the separate assembly using OData 3.

 

Our core R&D team will review this logic in the future releases, meanwhile the only way to access the object is using OData 4 only.

 

Best regards,

Oscar

Show all comments

Hi team,

 

Can you help me out with restoring the Feed tab in the Project section?

I deleted it but now I want Feed tab back.

 

Thank you in advance!

 

Kind regards,

Marijana

 

Like 0

Like

3 comments
Best reply

Hi Marijana,



if you've deleted Feed tab, you should have following text in DIFF part of page schema:



 

So, you can just remove them and Feed should appear again

Hi Marijana,

 

Thank you for your question!

 

If feed was deleted from the section, then the only way to add it back is only via additional development (or to restore it from the backup).



To add Feed you'll need to transfer it you page schema diff: http://prntscr.com/lei5bx, add LocalizableStrings: http://prntscr.com/lei5ip and add all methods responsible for Feed tab functionality, like loadESNFeed, getSocialFeedSandboxId, initTabs, messages (http://prntscr.com/lei64z

) and etc.

 

If you would like the instance to be restored from the backup - please, reach out to us at support@creatio.com and specify the name of the instance and the date we should use to restore it from.

 

Best regards,

Anastasiia

Hi Marijana,



if you've deleted Feed tab, you should have following text in DIFF part of page schema:



 

So, you can just remove them and Feed should appear again

Hello Anastasiia and Vladimir,

 

Thank you for your answers.

I used Vladimir solution (easier way) and it works nice. I have my Feed tab back! :)

Thanks again!

 

Kind regards,

Marijana

 

Show all comments