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 everybody. We'd applied a code from here https://academy.creatio.com/docs/developer/back_end_development/api_for… (Get file content part). The code is the following:

	byte[] data;
	Guid recordId = entities[0].GetTypedColumnValue<Guid>("Id");
	var fileLocator = new EntityFileLocator("KnowledgeBaseFile", recordId);
	IFile file = userConnection.GetFile(fileLocator);
	// Read the contents of the file in the content byte array. Remember to free the stream object by utilizing using! 
	using (Stream stream = file.Read()) {
	   data = stream.ReadAllBytes();
	}
 
	string s1 = Encoding.GetEncoding("Windows-1250").GetString(data);

actually it is the same as in the creatio example on the page:

 

byte[] content;
Guid recordId = Guid.NewGuid();
var fileLocator = new EntityFileLocator("ActivityFile", recordId);
IFile file = connection.GetFile(fileLocator);
 
// Read the contents of the file in the content byte array. Remember to free the stream object by utilizing using! 
using (Stream stream = file.Read()) {
   content = stream.ReadAllBytes();
}

unfortunately if fails with the following:

 

System.NotSupportedException: Specified method is not supported. at Terrasoft.File.Content.FileContentStream.get_Length() at Terrasoft.Common.StreamUtilities.ReadAllBytes(Stream source) at Terrasoft.Core.Process.EonFileProceedingCustom10MethodsWrapper.ScriptTask1Execute(ProcessExecutingContext context) at Terrasoft.Core.Process.ProcessFlowElement.ExecuteItem(ProcessExecutingContext context) at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)

 

honestly I don't understand the problem because it occurs in the core method :( Does anybody have a solution please?

 

8.0.6 sales team

 

Like 0

Like

1 comments

Hello,

You using ReadAllBytes(), however, even the article you provided used another method ReadToEnd().

Please change the method and see if the problem is still present.

 

using Terrasoft.Common;
 
var content = new byte[]();
Guid recordId = Guid.NewGuid();
 
/* Create a file locator for the new file. */
var fileLocator = new EntityFileLocator("ActivityFile", recordId);
IFile file = UserConnection.GetFile(fileLocator);
 
/* Read the contents of the file in the content byte array. Remember to free the stream object by utilizing using! */
using (Stream stream = file.Read()) {
   content = stream.ReadToEnd();
}

 

Show all comments

Hi,

I am using Case section for portal users but the messages posted by portal users in a case are not being visible to the Studio users, also the messages being posted by studio users are not visible to internal portal users.

Also, the UI for both Portal and Studio users are different.



Appreciate the help.

Like 0

Like

3 comments

Hello,

 

Currently, Freedom UI is not supported for Customer Portal, but we already have a registered task for the R&D team in regard to this question.

We have linked this post to the beforementioned R&D task to expedite the implementation process.

Bogdan,

Thanks for the reply,

Can you please suggest any workaround/solution that can be used to achieve the above mentioned functionality?

 

Janhav,



Unfortunately, there is no workaround for now.

Show all comments

Hi guys, did anyone try to integrate mapsly to Creatio mobile?

I need some guidance !

Is it only possible with adding Mapsly's Iframe ?

If yes where should i put the iframe ? in which Creatio schema ?

Thank you 

Like 0

Like

1 comments

Hello, in this case, we recommend reaching out to the technical support of Mapsly. You can use this email: help@mapsly.com 

Show all comments

Hi,

In the latest release note (https://academy.creatio.com/docs/release/release-notes/808-atlas-release-notes) it was mentionned that SSO with OpenID has been implemented in Creatio. I've started a trial and attempted to set it up, I am unsure about the endpoint that should be entered in the URL field. Has anyone successfully managed to set it up?

Like 0

Like

1 comments

Hello,



As of now the corresponding article about Custom OpenID is still in progress, but it should be available on our Academy soon. 

In the Url field the main endpoint should be specified.

In order to avoid any errors we'd suggest to double-check whether the field is populated with a correct value. 



Should you have any additional questions, please let us know.

Best regards,

Anastasiia

Show all comments

Hello Community,

 

I want to hide the elements "Home", "Run process" and "New" on the top menu:

 

 

This elements should be hidden for all roles. Can you please help me?

 

Thank you very much!

Like 1

Like

1 comments

Hello Javier,

 

To achieve this:

 

1) Create a module with no parent module in configurations called UsrLeftPanelTopMenuModule

2) Add the following content to the module:

define("UsrLeftPanelTopMenuModule", ["LeftPanelTopMenuModuleResources", "LeftPanelTopMenuModule"],
    function(resources) {
        Ext.define("Terrasoft.configuration.UsrLeftPanelTopMenuModuleViewModel", {
            alternateClassName: "Terrasoft.UsrLeftPanelTopMenuModuleViewModel",
            override: "Terrasoft.LeftPanelTopMenuModuleViewModel",
            getTopMenuConfig: function() {
                var menuConfig = [
					{
						id: "collapse-button",
						tag: "CollapseMenu",
						className: "Terrasoft.HoverMenuButton",
						style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
						classes: {
							imageClass: ["button-image-size"],
							wrapperClass: ["collapse-button-wrapperEl"]
						},
						imageConfig: resources.localizableImages.collapseIconSvg,
						click: {
							bindTo: "collapseSideBar"
						},
						hint: this.getCollapseSideBarMenuItemCaptionConfig(),
						markerValue: this.getCollapseSideBarMenuItemCaptionConfig()
					}
				];
				return menuConfig;
			}
        });
    }
);

and save the schema.

3) Create the replacing BootstrapModulesV2 view module (or use existing one if you already have it) and add the following content (add created UsrLeftPanelTopMenuModule as a dependency):

define("BootstrapModulesV2", ["UsrLeftPanelTopMenuModule"], function() {
	return {};
});

and save the schema.

4) Reload the page

 

The result will be:

Show all comments

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

Hello!

Need your help

On the specific step of the process I want to display list of contacts on the page and user have to have an opportyniti to filter this list.

How can i do it and what BPMN element i should use?

Like 0

Like

4 comments

 

Hi Anna,



Do you mean that you want to filter a list of contacts on the specific step of the DCM stage

I want to display this list to users and user shold have possibility to filter this list. All this i want to get using BPMN process

Anna,

 

Could you please detailly describe your business task with the screenshots?

Sure,

I got a process

 

At this step(highlighted in the square) I would like to display list of contacts for example 

Show all comments

Hi community,

 

I would like to know the base function that gets called when you click on a lookup value and takes you to a new page in FreedomUI. We are looking to override the function and add our own logic to it.

 

Thanks in advance.

 

Regards,

Abilash.S

Like 0

Like

1 comments

Hi,

 

In creatio-devkit-common there is the Bs class with the constructor with this function:

process: async t=&gt;{
                        const e = this._getHandler(t);
                        return null == e ? void 0 : e.handle(t)
                    }

and when the lookup value is clicked the "crt.7XRequest" request is caughth with the "EditRecord" action:

(payload stores information about which entity the lookup column represents and which record will be opened) after which page opening is performed. So you need to check for the "crt.7XRequest" request in your case.

Show all comments