How do I edit this page? For example, I want to add a column that will be displayed on general information.

Like 0

Like

1 comments

Hello Anjar,

Unfortunately, it's impossible to edit the account relationship page.

We've registered the new idea to our R&D team. 

Thank you!

Show all comments

Hello Creatio Community,

I am working on a project where I need to either replace or override an existing Creatio web service with a custom implementation. Specifically, I want to extend or modify the functionality of a base Creatio web service (e.g., CallServiceSchemaService) to fit my business requirements.

Here’s what I want to achieve:

  • Create a custom web service in a separate package without affecting the existing functionality of the base service.
  • Either extend the existing service (if possible) or completely replace it with my custom implementation.
  • I want to customize the behavior of how service requests and responses are handled, while ensuring that all references to the original service use my new service.

Questions:

  1. What is the best approach to achieve this in Creatio? Should I extend or replace the service, and what are the steps to do so?
  2. How can I ensure that the system references my custom service in place of the base service without breaking existing functionality?
  3. Are there any best practices or limitations I should keep in mind when implementing custom web services in Creatio?

I would appreciate any guidance, examples, or documentation that can help me with this process.

Thank you!

Like 0

Like

1 comments
Best reply

Hi,

 

We would recommend not to redo the standard web service page, but to set up a custom service.

Here are the options for configuring the integration:

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/architecture/development-in-creatio/integrations

Hi,

 

We would recommend not to redo the standard web service page, but to set up a custom service.

Here are the options for configuring the integration:

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/architecture/development-in-creatio/integrations

Show all comments

Hi, all senior mentors, 

 

    I'd like to use the system setting for maintaining order gross profit %, however, when I add one new system setting, I found the decimal value with only  two decimal places, which is 0.01, I can't not use 0.015. please see the attachment.

   Any idea how to solve it? please help.

Like 0

Like

2 comments

Believe the column 'FloatValue'  is located in the 'System setting value' object 

Hello! 

Thank you for your question. 

Unfortunately, at the database level, there is a limit of two characters after the dot.

We appreciate your input and will record this suggestion as an idea for consideration.

Alternatively, if you need to use this value in a business process, you can programmatically designate the type as "Text" and convert the string to a decimal format.

Show all comments

Hi Creatio Community,

I am working on extending the existing implementation of the Execute method in the web service designer, which is part of a base package in Creatio. My goal is to modify the method to add additional functionality: specifically, I want to save the web service response as a record using an EntitySchemaQuery (ESQ), so that the response can be displayed in a custom section inside Creatio.

However, I am encountering a compilation error:

Error:
cannot convert from 'System.Collections.Generic.IEnumerable<Terrasoft.Configuration.ServiceSchemaParameter>' to 'System.Collections.Generic.IEnumerable<Terrasoft.Configuration.ServiceSchema.ServiceSchemaParameter>'

It appears that the system is having difficulty converting between two types that have the same name but are possibly from different namespaces. I am using ServiceSchemaParameter in my custom implementation, but the IServiceSchemaClient.Execute() method is expecting the parameter to be of a slightly different type.

Here’s an overview of my approach:

  1. I've modified the Execute method to include an ESQ that logs the web service call and stores the response.
  2. The issue arises when passing the parameters (of type List<ServiceSchemaParameter>) to the Execute method, where it's expecting IEnumerable<ServiceSchema.ServiceSchemaParameter>.
  3. I believe the conflict is due to namespace ambiguity or mismatched types between base and custom implementations.

    My code: 
     
  4. namespace Terrasoft.Configuration
    {
     
     
        using System;
        using System.Linq;
        using System.Collections.Generic;
        using System.Runtime.Serialization;
        using System.ServiceModel;
        using System.ServiceModel.Web;
        using System.ServiceModel.Activation;
        using Terrasoft.Core.Factories;
        using Terrasoft.Services;
        using Terrasoft.Web.Common;
        using Terrasoft.Core;
        using Terrasoft.Core.Entities;
        using Terrasoft.Configuration.ServiceSchema;
     
    	#region Class: CallServiceSchemaService
     
    	[ServiceContract]
    	[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    	public class CallServiceSchemaService : BaseService
    	{
    		#region Methods: Public
     
    		[OperationContract]
    		[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
    			ResponseFormat = WebMessageFormat.Json)]
    		public CallServiceSchemaResponse Execute(string serviceName, string methodName, List<ServiceSchemaParameter> parameters) {
    			if (parameters == null) {
    				parameters = new List<ServiceSchemaParameter>();
    			}
    			try {
    				UserConnection.DBSecurityEngine.CheckCanExecuteOperation("CanManageSolution");
     
    				// Getting the builder and client from the ClassFactory
    				var builder = ClassFactory.Get<IServiceSchemaParameterBuilder>();
    				var serviceSchemaClient = ClassFactory.Get<IServiceSchemaClient>();
     
    				// No need to cast, List<T> already implements IEnumerable<T>
    				var serviceResponse = serviceSchemaClient.Execute(UserConnection, serviceName, methodName, builder.Build(parameters.AsEnumerable()));
     
    				// Log the request and response
    				LogWebServiceCall(serviceName, methodName, parameters, serviceResponse);
     
    				return new CallServiceSchemaResponse(serviceResponse);
    			} catch (Exception e) {
    				return new CallServiceSchemaResponse(e);
    			}
    		}
     
    		#endregion
     
    		private void LogWebServiceCall(string serviceName, string methodName, List<ServiceSchemaParameter> parameters,
                IServiceClientResponse response = null, Exception error = null) {
                var entitySchema = UserConnection.EntitySchemaManager.GetInstanceByName("UsrWebServiceLog");
                var assignersEntity = entitySchema.CreateEntity(UserConnection);
                assignersEntity.SetDefColumnValues();
     
                assignersEntity.SetColumnValue("UsrServiceName", serviceName);
                assignersEntity.SetColumnValue("UsrMethodName", methodName);
                // Log additional columns if needed, as seen in your commented code
                assignersEntity.Save();
            }
     
    	}
     
    	#endregion
     
    	#region Class: CallServiceSchemaResponse
     
    	[DataContract(Name = "CallServiceSchemaResponse")]
    	public class CallServiceSchemaResponse : ConfigurationServiceResponse
    	{
    		#region Constructor: public
     
    		public CallServiceSchemaResponse(IServiceClientResponse serviceResponse) {
    			StatusCode = serviceResponse.StatusCode;
    			Success = serviceResponse.Success;
    			ResponseBody = serviceResponse.Body;
    			ResponseRawData = serviceResponse.RawDataResponse;
    			RequestBody = serviceResponse.RequestBody;
    			RequestRawData = serviceResponse.RawDataRequest;
    			ParameterValues = Newtonsoft.Json.JsonConvert.SerializeObject(serviceResponse.ParameterValues);
    		}
     
    		public CallServiceSchemaResponse(Exception e) : base(e) {}
     
    		#endregion
     
    		#region Properties: Public
     
    		[DataMember]
    		public int StatusCode;
     
    		[DataMember]
    		public string ParameterValues;
     
    		[DataMember]
    		public string RequestRawData;
     
    		[DataMember]
    		public string RequestBody;
     
    		[DataMember]
    		public string ResponseRawData;
     
    		[DataMember]
    		public string ResponseBody;
     
    		#endregion
    	}
     
    	#endregion
     
    	#region Class: ServiceSchemaParameter
     
    	[DataContract]
    	public class ServiceSchemaParameter
    	{
    		#region Properties: Internal
     
    		[DataMember(Name = "code")]
    		public string Code;
     
    		[DataMember(Name = "value")]
    		public object Value;
     
    		[DataMember(Name = "nested")]
    		public List<List<ServiceSchemaParameter>> NestedParameters;
     
    		#endregion
    	}
     
    	#endregion
    }

 

Request:
Could anyone guide me on how to properly resolve this type conversion issue? If there is a better way to manage the namespace or cast the types correctly, I would appreciate any advice or best practices to ensure compatibility between the types.

Thank you for your help!

Code Context:
CallServiceSchemaService.svc 
Service Designer Package

Looking forward to your suggestions and insights!

Like 2

Like

1 comments

Hello Pranshu Basak,

Please change the part of the code 

var serviceResponse = serviceSchemaClient.Execute(UserConnection, serviceName, methodName, builder.Build(parameters.AsEnumerable()));

to the new one:

var serviceResponse = serviceSchemaClient.Execute(UserConnection, serviceName, methodName, builder.Build((IEnumerable&lt;ServiceSchema.ServiceSchemaParameter&gt;)parameters.AsEnumerable()));

for solving the compilation error.

 

Show all comments

Hello. I need to create a QuickFilter on a Freedom UI Page whose value will change dynamically. I found a post https://customerfx.com/article/using-custom-attributes-on-a-creatio-fre… so I try to use the attribute but it does not work. Could you help me please?

{
    "filterType": 1,
    "comparisonType": 3,
    "isEnabled": true,
    "trimDateTimeParameterToDate": false,
    "leftExpression": {
        "expressionType": 0,
        "columnPath": "MyColumn"
    },
    "isAggregative": false,
    "dataValueType": 1,
    "rightExpression": {
        "expressionType": 2,
        "parameter": {
            "dataValueType": 1,
            "value": "$MyAttribute"
        }
    }
}
Like 0

Like

1 comments

Hello,
It seems that the attributes will not work properly with the filter, as an alternative I can suggest applying the full filter in a handler where you can change it as you want, for example:

		handlers: /**SCHEMA_HANDLERS*/[
          {
            request: "crt.HandleViewModelAttributeChangeRequest",
            handler: async (request, next) =&gt; {
            	const result = await next?.handle(request);
            	request.$context.DataGrid_7cyakqc_PredefinedFilter={"items": {
								"1893734f-7c93-40a5-9592-8e7231005e10": {
									"filterType": 1,
									"comparisonType": 7,
									"isEnabled": true,
									"trimDateTimeParameterToDate": false,
									"leftExpression": {
										"expressionType": 0,
										"columnPath": "Age"
									},
									"isAggregative": false,
									"dataValueType": 4,
									"rightExpression": {
										"expressionType": 2,
										"parameter": {
											"dataValueType": 4,
											"value": 20
										}
									}
								}
							},
							"logicalOperation": 0,
							"isEnabled": true,
							"filterType": 6,
							"rootSchemaName": "Contact"};
            	return result;
              }
          }
        ]
Show all comments

I want to see if any opportunity changed to a stage in the previous week. I think the setting I have shows what the current stage the opportunity was in.  I need it to show if it ever changed to that stage during that timeframe

 

Like 0

Like

1 comments

You could create a date field and populate it automatically in a business process when the opportunity stage changes. That way you will have the exact date it was updated. Depending on requirements you could do this for each stage

Show all comments
"PDS_UsrActualFuelRemaining_s06444m": {
                        "modelConfig": {
                            "path": "PDS.UsrActualFuelRemaining"
                        },
                        "validators": {
                            "MyNumberValidator": {
                                "type": "usr.MonthNumberValidator",
                                "params": {
                                    "minValue": "0",
                                    "message": "Допустимі значення від 0 до 500",
                                    "maxValue": "500"
                                }
                            }
                        }
                    },

 

If I specify a range, the validator works. But when I try to use <strong>var OldWorkHour = await request.$context.PDS_UsrWorkHours_sjx2srh;</strong>, I get an error.

Could you please help me figure out why this happens and how to fix it?

 

 "usr.MonthNumberValidator": {
   validator: function(config) {
       return function(control) {
           var controlValue = control.value !== undefined ? parseFloat(control.value) : null; 
 
           var minValue = config.minValue !== undefined ? parseFloat(config.minValue) : Number.MIN_SAFE_INTEGER; 
           var maxValue = config.maxValue !== undefined ? parseFloat(config.maxValue) : Number.MAX_SAFE_INTEGER; 
 
            var OldWorkHour = await request.$context.PDS_UsrWorkHours_sjx2srh;
 
           var isValueValid = controlValue >= minValue && controlValue <= maxValue;
           if (!isValueValid) {
 
               return {
                   "invalid": { 
                       message: config.message || "Введене значення не відповідає умовам"
                   }
               };
           }
 
           // Якщо все добре, повертаємо null (успішна валідація)
           return null;
       };
   },
   params: [
       {
           name: "minValue"
       },
       {
           name: "maxValue"
       },
       {
           name: "message"
       }
   ],
   async: false
},
Like 0

Like

2 comments

Hi,

 

And what is the datatype for the PDS_UsrWorkHours_sjx2srh and UsrActualFuelRemaining? And what is the error message you receive?

Hello,
The ability to add dynamic parameters to a validator is still under development, as a way around you can try using global variables like window. For example

handlers: /**SCHEMA_HANDLERS*/[
{
    request: "dw.StartDateChange",
    handler: async (request, next) => {
        window.StartDate = await request.$context.DateTimeAttribute_lpcf566;
        if(request.$context.IsStartDateInited) {
            request.$context.validate();
        }
        request.$context.IsStartDateInited = true;
        return next?.handle(request);
    }
}]                
...        

"dw.StartDateIsNotNotLessThanProjectStartDate": {
    "validator": function (config) {
        return function (control) {
            return (!control.value || control.value >= window.StartDate)
                ? null
                : {"dw.StartDateValidator": {message: config.message}};
        };
    },
    "params": [
        {
            "name": "message"
        }
    ],
    "async": false
}

Show all comments

Hello,

 

I need to call a code once a record gets created for the first time. This worked using the following:

handlers: /**SCHEMA_HANDLERS*/[
			{
        request: "crt.SaveRecordRequest",
        handler: async (request, next) => {

 

however what this does is execute the code for each attribute value change, which is not what is needed. How can I call this exactly once just when the record is created for the first time and that's it, without having to call it again for each save request? Thanks

 

Note: I have tried replacing SaveRecordRequest with CreateRecordRequest, however the code was not executed once saving, or on any save.

 

Best,

Mohamad

Like 0

Like

10 comments

You can use the CardState to see if the record is in add mode (record is being added, saved for first time) or edit mode:

const mode = await request.$context.CardMode;
if (mode === “add”) {
    //
}

If you need to call some code exactly once when a record is created, I'd suggest moving the whole logic to backend. Specifically EntityEventListener and implement OnInserting or OnInserted methods to call your logic before or after the record is saved

Ryan Farley,

Hey Ryan,

 

Thanks for the reply, however that didn't work. The CardMode returns undefined, and when inspecting it in developer tools (request.$context object) the value is always 'edit' , when inserting the first time or when updating. Is there anything else I can do to fix the issue? Thanks

 

Best,

Mohamad

Yurii Sokil,

Hey Yurii,

 

Thanks for the reply, I have tried moving the logic to backend, however I encountered some issues. The overloaded method OnInserted cannot be async, and therefore I cannot call APIs directly from that method.

There is another option to call asynchronously using this method https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/back-end-development/objects-business-logic#title-2173-11 . However that doesn't solve the problem as if there were any errors when executing the asynchronous code, the record gets saved normally without indicating errors. Its a fire and forget operation and I need something that prevents a record from being inserted if the API call failed. Is there any way I can achieve this? Thanks for help

 

Best,

Mohamad

Mohamad Salhani,

If all you're after is to set up an auto number column, you can use the new auto number column default value. See https://customerfx.com/article/working-with-autonumber-fields-in-creatio/

Ryan

Ryan Farley,

No, so basically I need to populate a field once a record is created, and the value comes from an external API that I have to call

Ryan Farley,

Thanks for the support, I was finally able to solve it by checking the createdOn and modifiedOn dates for the record and see if they are equal, this way I can identify if the record was added for the first time or not. 

Thanks again!

Hi Mohamad, 
You can use AsyncPump.Run() to call async methods synchronously in your event listener. Also you can override OnInserting rather than OnInserted so your logic is called before the record is actually saved. 

Yurii Sokil,

Hey Yuri,

 

Thanks for the reply! It did work however I have a question. How can I pass arguments to the method passed in AsyncPump.Run() ? 

I have this code, but I can't pass arguments to the method.

 

[EntityEventListener(SchemaName = "UsrPetolTest")]
public class CustomEntityEventListener : BaseEntityEventListener
{
    public override void OnInserting(object sender, EntityBeforeEventArgs e)
    {
        base.OnInserting(sender, e);
 
        var entity = (Entity)sender;
        var userConnection = entity.UserConnection;
 
        AsyncPump.Run(testing);
 
    }
 
    private async void testing()
    {
        try
        {

 

Best,

Mohamad

Show all comments

Hi There,

 

is it possible to configure the Timer Component, so it displays in days, weeks, months instead of hrs & minutes? 

i.e to count down 12month of a product warranty or to count up how long a warranty claim has been open.

 

thanks!

Like 0

Like

2 comments
Best reply

The timer will adjust to the units that makes the most sense for the time period. I have a timer component that is set as a "Count up timer" using the time since a case was created. If the time period is short it displays hours and minutes.

If the time period is long it automatically switches to months & days:

Ryan

The timer will adjust to the units that makes the most sense for the time period. I have a timer component that is set as a "Count up timer" using the time since a case was created. If the time period is short it displays hours and minutes.

If the time period is long it automatically switches to months & days:

Ryan

Ryan Farley,

Thank you Ryan, that's great! I have been hesistant to adding this, as it didn't make sense displaying in Hrs/Min. :)

Show all comments

Як створити звіт fastreport у версії 8.1.4? Є багато готових звітів і потрібно ще один зробити, але таку можливість забрали

Like 0

Like

1 comments

Розібрався. 

  1. 1. Потрібно створити пусту строку в таблиці FastReportTemplate
  2. 2. Новий запис в таблиці FastReportDataSource
  3. 3. Запис в SysModuleReport
  4. 4. Запис в SysModuleAnalyticsReport
  5. 5. звіт можна відкрити в сторінці "Налаштування звіту" і продовжити роботу
Show all comments