Hello,

some elements like button have "clicked" attribute, where we can configure which request should be emited and which params should be passed to its handler. I try to use this feature, but it doesn't always work I expected.

For example, I created two new elements on Accounts Form Page:

- a button

- a lookup (with adding new record from list control enabled)

 

The first one emit crt.CreateRecordRequest with some params, the second one consists of two viewConfigDiff entries: one of them is a crt.ComboboxSearchTextAction and emits crt.CreateRecordFromLookupRequest

request with no params.

I tried to add my custom param to both elements. You can see it at the source code I've attached to this post. Then, I created two handlers, for handling both types of requests. In the result I can access to my custom param from button click handler (the alert with text "Hello" shows up), but not for the lookup create new record handler (the alert display "undefined").

 

define("Accounts_FormPage", /**SCHEMA_DEPS*/[]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/()/**SCHEMA_ARGS*/ {
	return {
		viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
			{
				"operation": "insert",
				"name": "ComboBox_xj333ko",
				"values": {
					"layoutConfig": {
						"column": 1,
						"row": 9,
						"colSpan": 1,
						"rowSpan": 1
					},
					"type": "crt.ComboBox",
					"label": "$Resources.Strings.LookupAttribute_it9tgfm",
					"labelPosition": "auto",
					"control": "$LookupAttribute_it9tgfm",
					"listActions": [],
					"showValueAsLink": true,
					"controlActions": []
				},
				"parentName": "SideAreaProfileContainer",
				"propertyName": "items",
				"index": 8
			},
			{
				"operation": "insert",
				"name": "addRecord_al7wl16",
				"values": {
					"code": "addRecord",
					"type": "crt.ComboboxSearchTextAction",
					"icon": "combobox-add-new",
					"caption": "#ResourceString(addRecord_al7wl16_caption)#",
					"clicked": {
						"request": "crt.CreateRecordFromLookupRequest",
						"params": {
							"MyParameter": "Hello" // HERE
						}
					}
				},
				"parentName": "ComboBox_xj333ko",
				"propertyName": "listActions",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "Button_93h456o",
				"values": {
					"layoutConfig": {
						"column": 1,
						"row": 10,
						"colSpan": 1,
						"rowSpan": 1
					},
					"type": "crt.Button",
					"caption": "#ResourceString(Button_93h456o_caption)#",
					"color": "default",
					"disabled": false,
					"size": "large",
					"iconPosition": "only-text",
					"visible": true,
					"clicked": {
						"request": "crt.CreateRecordRequest",
						"params": {
							"entityName": "Contact",
							"defaultValues": [
								{
									"attributeName": "Age",
									"value": null
								}
							],
							"MyParameter": "Hello" // HERE
						}
					},
					"clickMode": "default"
				},
				"parentName": "SideAreaProfileContainer",
				"propertyName": "items",
				"index": 9
			}
		]/**SCHEMA_VIEW_CONFIG_DIFF*/,
		viewModelConfig: /**SCHEMA_VIEW_MODEL_CONFIG*/{
			"attributes": {
				"LookupAttribute_it9tgfm": {
					"modelConfig": {
						"path": "PDS.EvColumn1"
					}
				}
			}
		}/**SCHEMA_VIEW_MODEL_CONFIG*/,
		modelConfig: /**SCHEMA_MODEL_CONFIG*/{}/**SCHEMA_MODEL_CONFIG*/,
		handlers: /**SCHEMA_HANDLERS*/[
			{
				request: "crt.CreateRecordFromLookupRequest",
				handler: async (request, next) => {
					alert(request.MyParameter);
					return next?.handle(request);
				}
			},
			{
				request: "crt.CreateRecordRequest",
				handler: async (request, next) => {
					alert(request.MyParameter);
					return next?.handle(request);
				}
			}
		]/**SCHEMA_HANDLERS*/,
		converters: /**SCHEMA_CONVERTERS*/{}/**SCHEMA_CONVERTERS*/,
		validators: /**SCHEMA_VALIDATORS*/{}/**SCHEMA_VALIDATORS*/
	};
});

What can I do to make it's working? I use version 8.0.7 (.NET core).

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

This alert displays after click on the button:

And this alert displays after trying to add new record from the lookup:

 

Like 0

Like

4 comments

Hello Eryk,

 

You did everything correctly according to the basic logic and I was able to reproduce the same behaviour on my end. Additionally I reviewed the request in debugger, its context and other properties and wasn't able to locate the "MyParameter". I will pass this info to our core R&D team so they could make it possible to operate with custom parameters in terms of the CreateRecordFromLookupRequest request handler.

Oleg Drobina,

 

Is this the recommended way to pass custom parameters to a request handler in 8.1.3 and above? i.e. to just specify the parameter within the call to it from e.g. a button, and use it directly in the code? No decorations around the request handler, such as a params: [{"name": "someParamName"}] property similar to how Validators have? Or is there some more recommended way?

Harvey Adcock,

Thank you for your question.

You can read about decorating parameters in request handlers here. It is up to you how you implement the logic of your custom request handler; however, it is recommended to follow the guidelines provided by the Academy.

Let me know if you have any questions left, i will be glad to assist you!

Hello Harvey Adcock,

Update to your question. 
 

We got an answer from the R&D of the platform. There is no need and it is not recommended to decorate your parameters in custom request handler.

Hope this helps and let me know if you have any question left.

 

Show all comments

Hi,

 

I have a few checkbox fields on the Order page and would like to update the Order stage in the DCM based on the field values. Can anyone tell me what will be the best way to go about it?

Like 0

Like

4 comments

Hello Nirupama ,

You can use Business process to update the DCM .When the checkbox fields are modified have a trigger in Business process and modify the DCM stage using modify element

Pavan Manne,

Thanks, Pavan! That should work. I was just wondering if there is a way to do it from client side without creating a business process. Setting the Stage value through client code did not seem to work. Do you know if there is a way to update the DCM stage using client side code?

Thanks, Pavan! 

Show all comments

In Activity we wanted to filter owner field . currently all users are showing in the list but we need only to show active users ?

I try to add an attribute in the ActivityPageV2 but it does not work unlike in the contact section

        attributes: {

            "Owner": {

                // Attribute data type.

                "dataValueType": Terrasoft.DataValueType.LOOKUP,

                "lookupListConfig": {

                    "filters": [

                        function() {

                            var filterGroup = Ext.create("Terrasoft.FilterGroup");

                            filterGroup.add("IsUser",Terrasoft.createColumnIsNotNullFilter("[SysAdminUnit:Contact].Id"));

                            

                            filterGroup.add("IsActive",

                                            Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL,"[SysAdminUnit:Contact].Active",true));

                            return filterGroup;

                        }

                    ]

                }

            },

        },

Like 0

Like

2 comments

Hi,

Your code doesn't work on the Activity page because it has additional logic to owner filters.

In order to make it work you need to override method _applyLookupListConfigToOwnerColumn in the ActivityPageV2 and make it empty:

            _applyLookupListConfigToOwnerColumn: function() {

                return false;

            }

Thank you

Show all comments
Question

Hello community,

                                while adding SVN to other repositories. I am getting an issue no such host is known. please help me through this problem.

File attachments
Like 0

Like

1 comments

Hi!

 

I wasn't able to reach the specified address - https://naveen/svn/paasprojectwork/

Please make sure it is available svn address and try again.

Show all comments

I have a business process where I want to go through a collection of records, so I create a sequential sub-process to go through them. To this sub-process I also want to pass a string from main process to sequentially concatenate new values onto the string passed between main and sub-process. 

 

For each new instance of sub-process I would then have a string in main process that is updated to "1" and then "1,2", then "1,2,3" and so on. 

 

I have created this string in main process and passed it to a corresponding string in sub-process, however when passing the parameter I cant get it to set a value that is retained in main process. I will attach pics to describe the scenario better:

And here is the subprocess:

Like 0

Like

6 comments
Best reply

Hi!

 

Unfortunately, in a business process using a sequential subprocess, direct data transfer between the parent and subprocess between iterations is not possible. The parent process cannot read or receive data created by the subprocess because that data is not persisted between iterations.

However, you can achieve the desired result by storing the values between iterations in a database table instead of your current element "Set relation role on Actor A". The subprocess can write each new value to this table, and the parent process can retrieve this data from the table after each iteration.

Here's how you can do it:

  1. Create a table in the database that will be used to store the values. For example, name it "SubprocessData" and add a column to store the values (e.g., "Value").

  2. In the subprocess, after computing the new value, perform an insertion operation to insert that value into the "SubprocessData" table.

  3. After the subprocess completes, in the parent process, execute a query against the "SubprocessData" table to retrieve all the values stored during the subprocess iterations.

  4. Use the retrieved values for further processing in the parent process, such as creating strings like "1", "1,2", "1,2,3", and so on.

This approach will allow you to persist values between iterations and pass them from the subprocess to the parent process.

Pics below

Hi!

 

Unfortunately, in a business process using a sequential subprocess, direct data transfer between the parent and subprocess between iterations is not possible. The parent process cannot read or receive data created by the subprocess because that data is not persisted between iterations.

However, you can achieve the desired result by storing the values between iterations in a database table instead of your current element "Set relation role on Actor A". The subprocess can write each new value to this table, and the parent process can retrieve this data from the table after each iteration.

Here's how you can do it:

  1. Create a table in the database that will be used to store the values. For example, name it "SubprocessData" and add a column to store the values (e.g., "Value").

  2. In the subprocess, after computing the new value, perform an insertion operation to insert that value into the "SubprocessData" table.

  3. After the subprocess completes, in the parent process, execute a query against the "SubprocessData" table to retrieve all the values stored during the subprocess iterations.

  4. Use the retrieved values for further processing in the parent process, such as creating strings like "1", "1,2", "1,2,3", and so on.

This approach will allow you to persist values between iterations and pass them from the subprocess to the parent process.

Alla Blinova,

Hello. Sorry for the late reply, this approach actually worked using a database field to store the value from each subprocess iteration. Thanks for the detailed explanation!

Show all comments

Like 0

Like

1 comments

Hello,

 

This error is related to the connection timeout with the application server.

Try running the action again.

Show all comments

Hi community,

There is a system user needs to operate with records in several different objects. But I don't want that user can delete any records

Is there any way to set up permission for that?

 

Thank you!

Like 0

Like

1 comments

Hello,

I am looking to extract the sort field and sort order being used by a user on a section and implement this same sort condition into an EntitySchemaQuery so that it brings back data in the same order.

I see the information exists in the SysProfileData.ObjectData field. Are there any modules/libraries that can help simplify the extraction of the sort columns? In particular the use of a sort based on an aggregate field has a complex structure to it and seems difficult to translate to an ESQ condition.

 

Thanks in advance!

Like 0

Like

2 comments
Best reply

Hello,

 

Additional question: should it be a client-side or server-side logic? Because if this is a client-side logic then you need the same logic as in the initQuerySorting method from the GridUtilitiesV2 module in the UI that gets the sorting column and add adds it to client-side ESQ when loading the grid:

and use the same in your logic. If this is a server-side implementation this is more complicated, try debugging the ReadProfileData method from the CommonUtilities class that reads profile data.

Hello,

 

Additional question: should it be a client-side or server-side logic? Because if this is a client-side logic then you need the same logic as in the initQuerySorting method from the GridUtilitiesV2 module in the UI that gets the sorting column and add adds it to client-side ESQ when loading the grid:

and use the same in your logic. If this is a server-side implementation this is more complicated, try debugging the ReadProfileData method from the CommonUtilities class that reads profile data.

I am working on the client side, so this helps a lot. Thank you!

Show all comments

Hi Community,

I am trying to save a file in a Creatio Cloud solution. Which is the relative path I can use to store the file ?

Is this correct:

\..\..\inetpub\wwwroot\creatio_instance_name\ ?

Sasori

Like 0

Like

0 comments
Show all comments

Hi,

I've created a remote angular module for Freedom UI, following the tutorial: https://academy.creatio.com/docs/developer/front_end_development_freedo…

I added my component to Freedom UI library. Thus, I'm able to drag'n'drop my component to page area.

The problem is that my component have some configuration params (a string and an integer), that I can't fill using the no-code designer. I have to do it manually, from source code.

I would like to add such configuration options to component to make it possible to configure a component instance in no-code way.

For example, when I create button I can change its label or action performed on click event. I would like to achieve something similar with my component.

I use Creatio 8.0.7

I will be really grateful for your answers :)

Eryk

 

Like 3

Like

6 comments

Could anyone help me? :)

Hi,

Can you please give more detail on these configuration params you are talking about? Some screenshots would be nice.

Dmytro Vovchenko,



Yes, sure :)

Some elements, like an input, have many configuration options:

 

And my component not:

 

So, I'd like to add similar configuration options to my custom component to reduce amount of coding while using custom angular components.

 

Hi,

Unfortunately for now the system does not support such no-code option.

However, already informed our developers about this option and they will work on this feature in future versions.

Thank you for helping us improve the system.

Hi, has anything changed since last time? :)

Hello,



After reviewing all the information, we inform you that at the moment the system still does not support this kind of no-code option. However, this particular request has been passed on to the responsible team for consideration and implementation in future releases. Task number: PR-29433.

Show all comments