Dear community,

Using "useThousandSeparator": false we can remove comma in section edit page or detail edit page. How do we do it in Section list Page?

 

Thanks

Like 0

Like

4 comments

Hello Shivani,

 

You can change the column format in prepareResponseCollectionItem method.

Here is a sample:

define("SomeSection", [], function() {
    return {
        entitySchemaName: "SomeSectionSchema",
        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
        methods: {
            prepareResponseCollectionItem: function(item) {
                this.callParent(arguments);
               
                var someColumn = item && item.columns && item.columns.SomeColumn;
                if (someColumn) {
                    someColumn.dataValueType = Terrasoft.DataValueType.TEXT;
                    item.set("SomeColumn", item.values.SomeColumn.toString());
                }
            }
        }
    };
});

 

Best regards,

Bogdan S.

Bogdan Spasibov,

That is fantastic Bogdan. Thanks for sharing this!

Ryan

This works for the section - is there a code for a detail on the contact page? I need to remove the comma from the year field here

Hi Heather, 

 

Please refer this post where this question was explained.

 

https://community.creatio.com/questions/special-character

 

The logic for section differs from page and there is no way to apply the property to the grid.

 

Regards,

 

Bogdan L.

Show all comments

Hello Community,

 

We have a case where images that we inserted via the Database into SysImage went missing. The steps we followed was to insert records into SysImage directly and later map that image Id to the relevant section. 



Does Creatio automatically purge specific records in the SysImage table under ANY condition? If Yes, what are those conditions? Besides purging, does Creatio also go and update the reference Image Id column in the section?

 

I vaguely remember from a previous experience that Creatio did purge records based on some condition. Request your assistance.

Like 0

Like

3 comments

For those searching for an answer - 



Yes, Creatio does purge the record from SysImage if the referenced image column in the section is marked as NULL. 

M Shrikanth,

That is good to know. Thanks for posting this follow up!

Ryan

M Shrikanth,

Yes, that is correct. This is done by means of a stored procedure called tsp_CleanUpSysImageMSSql.

 

Best regards,

Bogdan S.

Show all comments

Hi Team

 

I need to perform some calculations based on data in the dashboard we did some implementation in the pivot table. we are able to get sum 2 fields based on all filter but further using that calculation to display the ratio of that 2 calculation is where I am stuck.

 

I am using https://academy.creatio.com/documents/technic-sdk/7-16/adding-custom-da…

To come up with some approach but didn't succeed anyone please suggest a solution to this requirement

Any workaround will be appreciated

 

 

Thank You 

 

Like 0

Like

3 comments

Hello Braj,

 

Can you please provide more information on what task do you want to cover? We need some practical examples to think about the solution.

 

Also have you tried to use this marketplace addon and does it fit your business task?

 

Best regards,

Oscar

Hi Oscar ,

 

we need to calculate loss ratio from some data sets 

 

ex. we have 100 records out of which 70 has profit field filled and 30 has loss field filled .

Based on filtration we performed on dashboard/pivot report we gets  records (N can be  10,20,30 or any number 

 

Now I want an loss ratio (loss/profit) of those N records only .

innthis case loss ratio = sum of loss from filtered records /sum of profits from filtered records

 

Hope you got the requirement if case any query please contact.

 

Thank You

Braj Raj singh Kushwaha,

 

Hello,

 

Unfortunately it's not quite clear what task do you want to achieve. Can you please add some screenshots of what is the desired result? Also can you please specify why the formula column type is not an option in our case?

 

Thank you in advance!

 

Best regards,

Oscar

Show all comments

Dear Community,

 

We have added a new icon to the communication panel. We would like to disable click for users and also add a tool tip to display the hints to the user when they hover over the icon. Any help here will be great!

Thanks in advance!

Like 0

Like

5 comments

Hello Shivani,

 

There are three different ways to add a hint depending on your control type. Try which one will work for you:

 

"tip": {

"content": {

"bindTo": "Resources.Strings.CustomerBillingInfoTip"

}

},

-----------------------

"hint": {

"bindTo": "Resources.Strings.GlbUseInternetTip"

},

--------------------

"controlConfig": {

"tips": [

{

"tip": {

"content": {"bindTo": "Resources.Strings.GlbUseInternetTip"}

},

"settings": {

"displayEvent": this.Terrasoft.controls.TipEnums.displayEvent.CLICK

}

}

]

}

 

To disable "click" behavior you can override a "click" method, like so: 

"click": {"bindTo": "onExampleButtonClick"}

 

Best regards,

Bogdan S.

Thank you Bogdan! The tool tip works. However, to disable the click (prevent opening communication panel module), I returned empty function in onExampleButtonClick(). This is opening up a blank side panel. Is there a way we can disable clicking itself? If I dont give return empty function, there are errors in the console.

Shivani Lakshman,

 

If you don't want users to click it you can simply hide this action using the "visible" parameter in the diff of the module. Like on the example below:

{
				"operation": "insert",
				"index": 10,
				"parentName": "communicationPanelContent",
				"propertyName": "items",
				"name": "testCTIModule",
				"values": {
					"tag": "testCTIModule",
					"visible": {"bindTo": "testCTIModuleVisible"},
					"imageConfig": {"bindTo": "testCTIModuleImageConfig"},
					"caption": {"bindTo": "testCTIModuleCaption"},
					"generator": "CommunicationPanelHelper.generateMenuItem"
				}
			}

You can return false in the testCTIModuleVisible attribute and hide the action or create a function that will hide it for some users.

 

Or you can override the onMenuItemClick function and if the selectedItemTag variable is your custom CTI panel action then return false in this function.

 

Best regards,

Oscar 

Oscar Dylan,

Thanks Oscar. The purpose of this icon is to just notify the users of a particular event which happens when we get a notification through API. Since the communication panel is visible throughout the platform, irrespective of the section the user is currently at, we have added this icon as a notification. Therefore we need it to be visible when the said event occurs but prohibit users from clicking it. Is that possible?

Shivani Lakshman,

 

Then you need to perform the modification of onMenuItemClick function as I mentioned in the previous post. Please debug its logic and add your own CTI panel element to the function logic modification.

 

Best regards,

Oscar

Show all comments

Hello community,

 

We are trying to restrict access of some Creatio users to specific IPs. We are doing this using the 'Range of allowed IP addresses' detail inside 'Access rules' in System users. We however cannot get this to work either on an on-premises installation or on a Creatio cloud installation.

 

Pls find below a screenshot showing that a user is able to login into the App outside of the permitted range of IPs. Are there special settings to be enabled/set to get this to work?? Does the server need to be restarted or Redis cache cleared or any additional step? What are we doing wrong? 

 

Thanks in advance

 

Like 0

Like

2 comments
Best reply

Hello!

It is also necessary to update the useIPRestriction parameter to true value in web.config. If you are uisng cloud instance - please approach our support team to update the value.

Apart from that, it is necessary to add the user or the role, that you want to restrict the IP access for, to the operation permission Ignore access check by IP address with NO access level.

 

Regards,

Dean

Hello!

It is also necessary to update the useIPRestriction parameter to true value in web.config. If you are uisng cloud instance - please approach our support team to update the value.

Apart from that, it is necessary to add the user or the role, that you want to restrict the IP access for, to the operation permission Ignore access check by IP address with NO access level.

 

Regards,

Dean

Dean Parrett,

Thank you Dean. It was the Web.Config setting. This was not available anywhere in the Academy/Community

Show all comments

Hi All,

I have used the quickFilterModule in one of the detail. I am able to see the filter on opening of the page.







When I switch between Tabs in the EditPage and again come back to this detail, I am not able to see the filter. But the data been get filtered as per the current week by default.





I have called this filter both in init as well as onRender functions. I have debuged it, on switching between tabs, Onrender is been called which calls the quickfilterconfig. But still its not coming up in UI. 

I am not able to figure out the root cause for it.

And also, by default it's taking the date range for the current week - How to remove the default date set?



Can anyone help me out with this issue ?



Regards,

Adharsh S

Like 0

Like

4 comments
Best reply

Adharsh,

Hello,

 

You have this logic being implemented in the defValue for startDate and dueDate. These are:

 

defValue: this.Terrasoft.startOfWeek(new Date())

defValue: this.Terrasoft.endOfWeek(new Date())

 

You can remove defValues and the filter will empty itself when browsing between tabs.

 

Best regards,

Oscar

Hi Adharsh,

 

To fix this behavior fast you can add this line to the init function after this.callParent(arguments);

this.set("IsDetailFilterVisible",true);

I've noticed that in case there is an original filter initialized it won't let a custom filter to disappear from the page when browsing between tabs. As a result you will achieve the result desired.

 

Best regards,

Oscar 

Thanks, Oscar Dylan

Regards Adharsh

Hi Oscar,

Also, the custom filter always defaults to the current week. But there is no such condition given explicitly as show the current week. Even though if we remove the filter and again when we switch to that Tab or reloads the page that current week filter been setup automatically. How can we remove the default filter and set it to an empty value?



Regards,

Adharsh

Adharsh,

Hello,

 

You have this logic being implemented in the defValue for startDate and dueDate. These are:

 

defValue: this.Terrasoft.startOfWeek(new Date())

defValue: this.Terrasoft.endOfWeek(new Date())

 

You can remove defValues and the filter will empty itself when browsing between tabs.

 

Best regards,

Oscar

Show all comments

Hi

 

I'd like to set up a user role (Internal Admin) that can:

Create / Upadate / Delete users except system administrators.

I have activated these three operations permission:

  • CanManageAdministration
  • CanAdministratePortalUsers
  • CanManageUsers

So now it can manage all the users including the Supervisor.

Then I added the object permission for the SysAdminUnit:

 

Now from the Internal Admin user, I can see the Supervisor and edit his information including the password:

 

Any help?

 

Thank you

Mohamed

 

Like 0

Like

6 comments

Hello Mohamed,

 

Here is an example of how to permit or deny modifying the user page (UserPageV2) of system users that are system administrators (the one on the screenshot below):

To do this you need to create a replacing view model for "Edit page - User" (UserPageV2) with the code similar to the one below:

define("UserPageV2", ["RightUtilities"],
	function(RightUtilities) {
		return {
			entitySchemaName: "VwSysAdminUnit",
			attributes: {
              CanEditSystemAdministrator:{
                dataValueType: this.Terrasoft.DataValueType.BOOLEAN,
                type: this.Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
                value: true
              }
            },
			properties: {},
			mixins: {},
			diff: /**SCHEMA_DIFF*/[
              {
					"operation": "merge",
					"name": "Name",
					"parentName": "FormAuthGridLayout",
					"propertyName": "items",
					"values": {
						"enabled":{bindTo:"CanEditSystemAdministrator"}
					}
				},
              {
					"operation": "merge",
					"name": "UserPassword",
					"parentName": "FormAuthGridLayout",
					"propertyName": "items",
					"values": {
						"enabled":{bindTo:"CanEditSystemAdministrator"}
					}
				}
            ],
			methods: {
              checkIfTheUserIsASystemAdministrator: function (){
                var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "SysAdminUnitInRole" });
					esq.addColumn("SysAdminUnit");
                	esq.addColumn("SysAdminUnitRoleId");
					esq.filters.addItem(esq.createColumnFilterWithParameter(3, "SysAdminUnit", this.get("PrimaryColumnValue")));
                	esq.filters.addItem(esq.createColumnFilterWithParameter(3, "SysAdminUnitRoleId", "83A43EBC-F36B-1410-298D-001E8C82BCAD"));
                	this.console.log("The Id is: "+this.get("PrimaryColumnValue"));
					esq.getEntityCollection(function (result) {
						if (result.success && result.collection.getCount() > 0) {
							result.collection.collection.each(function(item) {
                              	var collectionValue = result.collection.getByIndex(0);
                              	var actualId = collectionValue.get("Id");
								this.console.log("ESQ result: "+actualId);
                              	this.canEditRecordOperation();
                            }, this);
						}
				}, this);
              },
              init: function(){
                this.callParent(arguments);
                this.checkIfTheUserIsASystemAdministrator();
              },
              canEditRecordOperation: function(){
                var operationsToRequest = [];
                operationsToRequest.push("CanEditSystemAdministrator");
                RightUtilities.checkCanExecuteOperations(operationsToRequest, function(result) {
                    if (result) {
                        this.set("CanEditSystemAdministrator", result.CanEditSystemAdministrator);
                        console.log("Can user edit record? "+ result.CanEditSystemAdministrator);
                    }
                }, this);
              }
            }
		};
	});

You will also need to add all the fields to the schema diff to include all other fields (in my example "Username" and "Password" fields are included into the logic). Also you need to create an operation permission with the "CanEditSystemAdministrator" code. As a result each time the page is opened an ESQ query is executed to check if the system user whose page was opened is a system administrator or not (included into "System administrators" role or not).

 

As a result even if the Supervisor user is not added to the list of users in the "CanEditSystemAdministrator" system operation this user won't be able to edit "Username" or "Password" columns:

As for visibility of system administrators in the detail you mentioned or in the section grid - I believe its a complicated task and applying the method above will restrict users from editing existing records so they won't be able to do anything with system administrators records (or will be able to do that in case they are added to the system operation users list).

 

Best regards,

Oscar

Oscar Dylan,

 

I got the main idea here.

It's a UI disabling strategy to prevent field updates based on a newly created Operation Permission.

I'm concerned about a user who can hack his way with the DataService API to edit the user password and bypass the UI limitation.



What do you think?

 

Thank you

Mohamed

Mohamed Ouederni,

 

Then you need to restrict the endpoint of such a dataservice for users that shouldn't modify system users (something I've described here). Because restricting access on the application level will be a hard task (if it's even possible).

 

Best regards,

Oscar

 

Ok, I will look at this:

Oscar Dylan writes:

Then you need to restrict the endpoint of such a dataservice for users that shouldn't modify system users (something I've described here).

I don't know why it's impossible to achieve this using Creatio Access Rights System.

I thought a combination of Operation / Object / Record Permissions will solve the task.

 

Oscar Dylan writes:

Because restricting access on the application level will be a hard task (if it's even possible).

Mohamed Ouederni,

 

It's because in the base UserPageV2 the "Actions" button is removed (this code on the UserPageV2):

{
					"operation": "remove",
					"name": "actions"
				},

Also the SysAdminUnit object has no SysAaminUnitRight table (and we remember that record access rights are stored in the SysEntityNameRight table that is created upon activating records access rights). So that's why I've proposed to create a JS logic on the page that will lock all the fields and will use a system operation to manage access.

 

Best regards,

Oscar

Show all comments

Hi All,

 

I have a use case, to data bind the printable and use it across instances. I have dataBinded with the object SysModuleReport, 







This is actual dataBind been setup in the instance,





But after the dataBinded and installed in other instance, I could see only Setup report data columns alone be binded but the associated Setup Report Tables are not been binded. As you see in below image,





Can you help me out with this, how to make a complete databind with all the setup in report tables also.



Regards,

Adharsh S

Like 0

Like

3 comments

Hello Adharsh,

 

It seems that SysModuleReportTable object wasn't bound to the package. Please also bind it and try to perform the installation once again.

 

Best regards,

Oscar

Oscar Dylan,

Hello Oscar, 

i absolutely have the same problem but i binded the SysModuleReportTable correctly.

 

BR, Stefan

Hello,

 

Please email us at support@creatio.com and show us the app. It's impossible to analyze such questions without actual access to the system where bindings were performed and the package developed, unfortunately. We will take the package, install it to the clean app and check the result and if the report tables are not passed to the target website we will check the bindings.

 

Best regards,

Oscar

Show all comments

Hello community



We have a use case where we need to migrate photos (Eg Contact display photo) into Creatio. We are aware that images are stored in the SysImage table, but going via the Database is not an option for us. 



I was looking into the 0/ImageAPIService/upload which is used by the platform internally when a Contact photo is uploaded. Can we use call API to upload an image into the SysImage table?? Subsequently we can map this Image the relevant record using the out of the box OData APIs. Few related questions below - 



1. Is the above API approach feasible?

2. I looked into what exact request was being sent and I notice a few query parameters - fileapi, totalFileLength, fileId and mimeType. If we were to replicate this request via code, Which of these are mandatory and which are optional? 

3. What does the query parameter "fileapi16123676529964" refer to? And what is that number??

4. Believe the unique Guid() for the SysImage record is generated on the client side, sent via the fileId query param and gets stored in the Id column in the SysImage table. Is this right?

5. Besides using the 0/ImageAPIService/upload API and the DB approach, is there any other way to import/migrate images into Creatio and map them to specific records?

Like 0

Like

6 comments
Best reply

M Shrikanth,

You can create a C# code schema with the following to add an image for an account or contact from a Url. This uses the ImageAPI found in the Terrasoft.Core.ImageAPI namespace.

var url = "https://somewebsite/someimage.png";
var entityType = "Account"; // or could be Contact
var entityId = someAccountId; // or contact Id
var imageField = "AccountLogoId"; // or if a contact, use "PhotoId"
 
using (var response = (WebRequest.Create(url) as HttpWebRequest).GetResponse())
{
	using (var responseStream = response.GetResponseStream())
	{
		using (var stream = new MemoryStream())
		{
			var fileId = Guid.NewGuid();
			responseStream.CopyTo(stream);
 
			var imageApi = new ImageAPI(UserConnection);
			imageApi.Save(stream, response.ContentType, url, fileId);
 
			using (var dbExecutor = UserConnection.EnsureDBConnection())
			{
				new Update(UserConnection, entityType)
					.Set(imageField, Column.Parameter(fileId))
					.Where("Id").IsEqual(Column.Parameter(entityId))
					.Execute(dbExecutor);
			}
		}
	}
}

This could be exposed as your own web service to simplify adding images to records. 

Hope this helps.

Ryan

Hello,

 

Please either use the database upload or use the standard approach of uploading files to the "Attachments and notes" detail. The ImageAPIService service is not supposed to be used for mass file upload and the database insert is the best approach in your case.

 

Best regards,

Oscar 

Oscar Dylan,



Hi Oscar. We do not want to migrate files into "Attachments & Notes" detail but rather migrate images so that they can be set as the profile picture (Ref screenshot https://prnt.sc/ylto0l). I don't think you can upload an image to the Attachments detail and then set it as the profile picture. Can you?



1. We have images stored in AWS S3 and not available in the file system to migrate. Hence, going via API is much more preferred than going via the DB.



2. Any specific reason why ImageAPIService should not or cannot be used? It is used by the platform when a user uploads a profile picture. Then why not use it from an external system??



3. Can you qualify what you mean by "mass file upload". Our use case is to migrate images before the system is used or goes live - We do not want to use this after the system has gone live or is being used by users. Given this context, Can you help with my questions above and also the original question of what the "fileapi" query parameter refers to?



4. Is the SysImage table exposed via OData? I verified that it is. But wasn't able to insert records into it via OData. I was able to do a GET request via OData and got the following results (https://prnt.sc/ylv178). When I tried to PATCH insert the image, I get a 405 Method not allowed (https://prnt.sc/ylvdor).



5. Is the SysImage table exposed via the Excel data import option? I could not find it being exposed. Am I missing something here?



Appreciate your help Oscar!

Oscar Dylan,

Hi Oscar, Can you help with the queries above? Thanks in advance.

M Shrikanth,

You can create a C# code schema with the following to add an image for an account or contact from a Url. This uses the ImageAPI found in the Terrasoft.Core.ImageAPI namespace.

var url = "https://somewebsite/someimage.png";
var entityType = "Account"; // or could be Contact
var entityId = someAccountId; // or contact Id
var imageField = "AccountLogoId"; // or if a contact, use "PhotoId"
 
using (var response = (WebRequest.Create(url) as HttpWebRequest).GetResponse())
{
	using (var responseStream = response.GetResponseStream())
	{
		using (var stream = new MemoryStream())
		{
			var fileId = Guid.NewGuid();
			responseStream.CopyTo(stream);
 
			var imageApi = new ImageAPI(UserConnection);
			imageApi.Save(stream, response.ContentType, url, fileId);
 
			using (var dbExecutor = UserConnection.EnsureDBConnection())
			{
				new Update(UserConnection, entityType)
					.Set(imageField, Column.Parameter(fileId))
					.Where("Id").IsEqual(Column.Parameter(entityId))
					.Execute(dbExecutor);
			}
		}
	}
}

This could be exposed as your own web service to simplify adding images to records. 

Hope this helps.

Ryan

Ryan Farley,

Hi Ryan. Thanks much for the alternate approach. 

Ryan Farley,

userconnection not working
Show all comments

Hello Community,

 

In the activities section, when a user adds a task between 11 PM to 12 midnight for a day, Creatio automatically displays it at the top of the day (Ref screenshot below). We would like to disable this behavior and display the slot only between 11 PM and 12 AM at the bottom of the day. This is a usability constraint for users who would like to view their whole day as they scroll vertically through the day.

 

We are aware that this might not be possible using Out of the box or configuration tools. How does one achieve the above using development? Thanks in advance. 

 

Like 0

Like

2 comments
Best reply

Hello,

 

You will need to override the logic of the multiDayItemConfig object from the schedule-item.js schema (Terrasoft.controls.ScheduleItem class) according to your business needs (this object represents the configuration of such elements on the page).

 

Unfortunately we don't have any practical example on our side, but you can study the code of the schema and test it.

 

Best regards,

Oscar

Hello,

 

You will need to override the logic of the multiDayItemConfig object from the schedule-item.js schema (Terrasoft.controls.ScheduleItem class) according to your business needs (this object represents the configuration of such elements on the page).

 

Unfortunately we don't have any practical example on our side, but you can study the code of the schema and test it.

 

Best regards,

Oscar

Oscar Dylan,

Hi Oscar. Thank you. Your approach helped us crack this one. 

Show all comments