Hi Community,

 

I want to create a Multiple Selection

How could I do that?

 

Thank you!

Like 0

Like

6 comments

Hello,

 

The possibility to use multi-select lookups in Freedom UI is registered as a feedback and will be available in future releases of Creatio’s platform.



At this moment, you can check the materials for Classic UI:

Marketplace solution:

https://marketplace.creatio.com/app/multi-select-text-field-setup-creatio

And a link to the community post where this issue has already been discussed, perhaps it will be helpful to you:

https://community.creatio.com/questions/multiselect-lookup

 

Best regards,

Anastasiia

Hello,

I've written up some steps to do this, however, it is only possible in version 8.1.

https://customerfx.com/article/invoking-a-multi-select-lookup-dialog-on…

In the near future I will be releasing a Freedom UI replacement for my marketplace addon linked previously by Anastasiia (Multi-select text field setup for Creatio)

Ryan

Ryan Farley,

 

Thank you for this! Could you also please confirm if adding detail records through multiselect is possible in 8.1? 

Ref: 

https://academy.creatio.com/documents/technic-sdk/7-11/adding-multiple-…

Shivani Lakshman,

Yes, however, for now you have to handle the adding of the records in code. The article I shared shows how to invoke the lookup in multi-select mode. It uses the results to flatten out to text, however, you could just use the results and do an insert for each into the list/detail. See here for how to do the insert: 

https://customerfx.com/article/inserting-a-record-from-client-side-code…

Ryan

Shivani Lakshman,

I wrote up the details for adding to a list from a multi-select lookup as a new article here: https://customerfx.com/article/adding-to-a-list-from-a-lookup-on-a-free…

Ryan

Ryan Farley,

Thank you! This will really help!

Show all comments

Hello. I'm working with the Multiple choice field setup for Creatio (https://marketplace.creatio.com/app/multiple-choice-field-setup-creatio) add-on but I'm not getting it to save the selected values.

I've followed the guide here: https://marketplace.creatio.com/sites/marketplace/files/app-guide/Multi…

I get the values correctly on the page, and they are selectable. But nothing is saved to the database when i Save the record

Object: UsrContactLabels

Lookup: UsrLabels

Link-object: UsrContact

 

 

Like 0

Like

10 comments

Hi Vasili,

Could you please give us more details about your issue?



Specifically, please describe your object model based on the following template:

The example implies the following conditions:

1. Multiple choice field was added to the Activity page.

2. The method uses the ActivityParticipant object linked to the Activity object.

3. The Contact object is a source object for the Multiple choice field.

 

As such, the structure comprises three main objects:

• Activity: main object

• ActivityParticipant: decoupling object

• Contact: source object for the Multiple choice field

 

Also, please send us the list of columns in the decoupling object, your Creatio version, product, and DBMS

Yevhen Vorobiov,



Thank you for your response,

DBMS is a MSSQL Server 19 ,

Creatio Version is 8.0.1,

Product is bpmonline bank customer journey on-site,

 

This is a  Piot Table, connecting contact and labels objects.

We are expecting that, all label information for all contacts will be saved in this Object "UsrContactLabels", after adding labels and saving the contact page, when we refresh the page it does not save it in object and after refreshing this field is empty.

 

 

We added multiselect element on Contact Page:

 

 

MultiSelect values are Labels from Lookup (sceen below):

• Activity: main object - For us is "UsrContact" (all our contacts)

• ActivityParticipant: decoupling object - For us is "UsrContactLabels" (Piot Table joining Contacts and Labels"Lookup")

• Contact: source object for the Multiple choice field - For us is "UsrLabels" (Labels Lookup)

Hi Vasili,

 

Thank you for the detailed description.

I tested your case on the same Creatio version, product, and DBMS. I created the same object model and was unable to reproduce the issue on my end.

Could you please send us the full JavaScript page code?

Also, please reproduce the issue with the browser console open. Do you get any errors in the console?

Hi Yevhen Vorobiov,

Thank you for your response.

I did not get any errors in console after selecting MultiSelect value and saving Contact Page.

Here we choose your Labels in MultiSelect without saving Contact Page.

Here we Saved Contact Page and There are no Errors in Console.

    attributes: {

            "UsrAutomaticLabel": {

                "dataValueType": Terrasoft.DataValueType.LOOKUP

                },

   },

        mixins: {

        MultiChoiceMixin: "Terrasoft.MultiChoiceMixin"

        },

methods: {

    getMultiChoiceEntitiesConfig: function () {

                const items = {

                        UsrAutomaticLabel: {

                            mainEntitySchemaName: "UsrContactLabels",

                            mainColumnName: "UsrContact",

                            relatedEntitySchemaName: "UsrAutomaticLabels",

                            relatedColumnName: "UsrLabels"

                            }

                        };

                        return items;

                        

                },

},

diff:[

        {

                "operation": "insert",

                "name": "UsrAutomaticLabel67a256f2-7c41-4c17-b736-ad94b31105ec",

                "values": {

                    "layout": {

                        "colSpan": 12,

                        "rowSpan": 1,

                        "column": 0,

                        "row": 0,

                        "layoutName": "GeneralInfoTabGridLayout9426c6e2"

                    },

                    "className": "Terrasoft.MultiChoiceCombobox",

                    "dataValueType": 11,

                    "bindTo": "UsrAutomaticLabel",

                    "enabled": true,

                    "contentType": 5

                },

                "parentName": "GeneralInfoTabGridLayout9426c6e2",

                "propertyName": "items",

                "index": 0

            },

 

 

]

Vasili Piruzashvili,

Hi Vasili,

 

Your source code has to include the following method:

init: function() {

                this.callParent(arguments);

                this.mixins.MultiChoiceMixin.init.call(this, arguments);

 

In other words, the source code should look as follows: 

methods: {
 
			init: function() {
				this.callParent(arguments);
				this.mixins.MultiChoiceMixin.init.call(this, arguments);
		},
 
    getMultiChoiceEntitiesConfig: function () {
                const items = {
                        UsrAutomaticLabel: {
                            mainEntitySchemaName: "UsrContactLabels",
                            mainColumnName: "UsrContact",
                            relatedEntitySchemaName: "UsrAutomaticLabels",
                            relatedColumnName: "UsrLabels"
                            }
                        };
                        return items;
 
                },
 
},



If the issue persists, please send me the complete source code of this page as text.

Hi Yevhen,

 

Sending source code:

define("ContactPageV2", ["MultiChoiceMixin"], function(MultiChoiceMixin) {
	return {
		entitySchemaName: "Contact",
		attributes: {
			"UsrAutomaticLabel": {
				"dataValueType": Terrasoft.DataValueType.LOOKUP
				},
		},
		mixins: {
		MultiChoiceMixin: "Terrasoft.MultiChoiceMixin"
		},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			onEntityInitialized: function() {
				window._contactObject = this;				
				this.callParent(arguments);
				this.mixins.MultiChoiceMixin.init.call(this, arguments);
 
			},
			getMultiChoiceEntitiesConfig: function () {
				const items = {
						UsrAutomaticLabel: {
							mainEntitySchemaName: "UsrContactLabels",
							mainColumnName: "UsrContact",
							relatedEntitySchemaName: "UsrAutomaticLabels",
							relatedColumnName: "UsrLabels"
							}
						};
						return items;
 
			},
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "STRING0d5c646a-a2a5-4b05-bdd5-91eda99aa462",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 6,
						"layoutName": "ProfileContainer"
					},
					"bindTo": "UsrExternalId",
					"enabled": true
				},
				"parentName": "ProfileContainer",
				"propertyName": "items",
				"index": 6
			},
			{
				"operation": "merge",
				"name": "ContactClientProfileIcon",
				"values": {
					"layout": {
						"colSpan": 4,
						"rowSpan": 1,
						"column": 0,
						"row": 0
					}
				}
			},
			{
				"operation": "merge",
				"name": "Type",
				"values": {
					"layout": {
						"colSpan": 20,
						"rowSpan": 1,
						"column": 4,
						"row": 0
					}
				}
			},
			{
				"operation": "move",
				"name": "Type",
				"parentName": "AdditionalContactProfileContainer",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "merge",
				"name": "AccountServiceLevel",
				"values": {
					"layout": {
						"colSpan": 20,
						"rowSpan": 1,
						"column": 4,
						"row": 1
					}
				}
			},
			{
				"operation": "merge",
				"name": "AccountBranch",
				"values": {
					"layout": {
						"colSpan": 20,
						"rowSpan": 1,
						"column": 4,
						"row": 2
					}
				}
			},
			{
				"operation": "merge",
				"name": "Owner",
				"values": {
					"layout": {
						"colSpan": 20,
						"rowSpan": 1,
						"column": 4,
						"row": 3
					}
				}
			},
			{
				"operation": "merge",
				"name": "BirthDate",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 1
					}
				}
			},
			{
				"operation": "merge",
				"name": "Citizenship",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 2
					}
				}
			},
			{
				"operation": "merge",
				"name": "ClientType",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 3
					}
				}
			},
			{
				"operation": "merge",
				"name": "SalutationType",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 4
					}
				}
			},
			{
				"operation": "merge",
				"name": "Language",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 12,
						"row": 3
					}
				}
			},
			{
				"operation": "move",
				"name": "Language",
				"parentName": "ContactGeneralInfoBlock",
				"propertyName": "items",
				"index": 7
			},
			{
				"operation": "merge",
				"name": "Age",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 5
					}
				}
			},
			{
				"operation": "move",
				"name": "Age",
				"parentName": "ContactGeneralInfoBlock",
				"propertyName": "items",
				"index": 8
			},
			{
				"operation": "insert",
				"name": "LOOKUP5f31e5a7-d07e-4752-925a-df3453f2a040",
				"values": {
					"dataValueType": Terrasoft.DataValueType.ENUM,
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 0,
						"layoutName": "ContactGeneralInfoBlock"
					},
					"className": "Terrasoft.MultiChoiceCombobox",
					"bindTo": "UsrAutomaticLabel",
					"enabled": true,
					"contentType": 3
				},
				"parentName": "ContactGeneralInfoBlock",
				"propertyName": "items",
				"index": 9
			},
			{
				"operation": "merge",
				"name": "ContactPageV26Tab",
				"values": {
					"order": 2
				}
			},
			{
				"operation": "merge",
				"name": "JobTabContainer",
				"values": {
					"order": 5
				}
			},
			{
				"operation": "merge",
				"name": "HistoryTab",
				"values": {
					"order": 6
				}
			},
			{
				"operation": "merge",
				"name": "NotesAndFilesTab",
				"values": {
					"order": 7
				}
			},
			{
				"operation": "merge",
				"name": "ESNTab",
				"values": {
					"order": 8
				}
			},
			{
				"operation": "move",
				"name": "Gender",
				"parentName": "ContactGeneralInfoBlock",
				"propertyName": "items",
				"index": 5
			},
			{
				"operation": "move",
				"name": "INN",
				"parentName": "ContactGeneralInfoBlock",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "move",
				"name": "SocialStatus",
				"parentName": "group51e8654c265f_gridLayout",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "move",
				"name": "DecisionRole",
				"parentName": "JobInformationBlock",
				"propertyName": "items",
				"index": 5
			},
			{
				"operation": "move",
				"name": "Job",
				"parentName": "JobInformationBlock",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "move",
				"name": "EmploymentType",
				"parentName": "JobInformationBlock",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "move",
				"name": "Account2",
				"parentName": "JobInformationBlock",
				"propertyName": "items",
				"index": 2
			}
		]/**SCHEMA_DIFF*/
	};
});

 

Yevhen Vorobiov,

Hi Yevhen, I made new Server and added Multiple Choice as it was in documentation. I have same problem with saving data. There are not any error in console ,  after chosing multiple Choiche values "Labels"  and saving Contact page, but after reloading the page the data is not saved and Labels are deleted so its empty .

Hi Vasili,

I can see that your code uses this method:

methods: {
onEntityInitialized: function() {
window._contactObject = this;
this.callParent(arguments);
this.mixins.MultiChoiceMixin.init.call(this, arguments);
},

However, the instruction uses the following method instead:

methods: {
init: function() {
this.callParent(arguments);
this.mixins.MultiChoiceMixin.init.call(this, arguments);
},

When I use the former method, I get the same issue. I can select data in the field, but Creatio will not save it. When I use the method from the instruction, everything works as expected.
Could you please test the method from the instruction? Is using a different method required in your case?

It worked! Thanks a lot

Show all comments

Hello team,

 

I have a multiselect lookup and a requirement where already selected records must be checked. I have used config.selectedValues to mark already selected records. 

 

Unfortunately, the application takes a lot of time (from 6 to 15 seconds) before the already selected records are marked on the UI. Hence the users are selecting records again and creating duplicates. There are other validation issues around this as well.

 

Is there a way to stop user from selecting further records till all existing records are marked checked? Please have a look at the video.

 

The use case in short, is to ensure that the checked records are marked and only then the user is allowed to choose further records.

Like 1

Like

1 comments

Hello,

Unfortunately, I didn't know a way to disable the checkbox on the lookup window and don't even know if that option is possible, however, in your case you can try a different approach. 

You can add a filter to an openLookup config that won't shop any records and disable it when you are using your config.selectedValues option.

Show all comments

Hi All,

 

Can we implement a multiselect lookup with a DB view object?

If yes, how?

 

Any info on this will be much helpful.

 

Thank you.

 

Regards,

Anitha Premkumar

Like 0

Like

1 comments

Hello,

 

To implement this logic, please check out these articles on Community:

https://community.creatio.com/questions/implementing-multi-select-lookup

https://community.creatio.com/questions/multiselect-lookup

 

They should help you out in your business task. If it is not quite what was needed, kindly specify with more detail what exactly you are trying to implement.

Show all comments

Hello team,

 

I have a multiselect detail and I have added code to mark already selected records when the lookup window is opened again. For example if A, B are already added to the multiselect, when user wants to add C,D, E, the records A & B will already be checked.

 

There are multiple validations done before we add a record. Unchecking of already added records will cause complication. 

 

We see preventing uncheck of values as a solution. Is there a way to prevent uncheck of records? 

Like 0

Like

4 comments

Hello Shivani, 

 

Can you please provide the code you are referring to? 

 

Best Regards, 

Igor

 

Ihor Skohariev,

Following is the code I have used, to mark the records already selected as marked. I need to prevent these marked records as unmarked. Basically, we cannot uncheck an already checked record

esq.getEntityCollection(function(result) {
                 	var existsDocumentsCollection = [];
                 	if (result.success) {
                         		result.collection.each(function(item) {
                         		existsDocumentsCollection.push(item.get(”AccountId”));
                          });
                        }
		config.selectedValues = existsDocumentsCollection;

 

Hello, is it correct that currently every time you open and close a lookup window there are no selected records and your code doesn't work? Or it's working but only after validation and you need to make it that the needed values are already selected before that moment?

Dmytro Vovchenko,

 

We have managed to figure this out using custom logic. The rows already selected are marked when we add more records. 

Show all comments

Hello team,

I have an editable detail to which we need to add records through multi select lookup. I want to copy the values into the detail from multi select lookup instead of referencing it, so that any change in the detail is not reflected in the lookup. 

How do I achieve this?

Like 0

Like

1 comments

Hello,

 

The multi-select lookup will be not checked by itself. Its purpose is to get multiple values from somewhere and create the record in the detail. Please find more information about this functionality by the link below:

https://academy.creatio.com/documents/technic-sdk/7-15/adding-multiple-records-detail

 

Could you please elaborate on your business task?

Please do not hesitate to provide us with the screenshot with explanations. 

 

Are you interested in the implementation of your business task with development?

Show all comments
define("ContactPageV2", [], function() {
	return {
		entitySchemaName: "Contact",
		attributes: {
 
		},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "hasForeignTrade",
				"values": {
					"click": "getLookupConfig",
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 2,
						"layoutName": "ContactGeneralInfoBlock"
					},
					"bindTo": "UsrHasForeignTrade",
					"labelConfig": {
						"caption": {
							"bindTo": "Resources.Strings.hasForeignTrade"
						}
					},
					"enabled": true,
					"contentType": "Terrasoft.core.enums.ContentType.LOOKUP"
				},
				"parentName": "ContactGeneralInfoBlock",
				"propertyName": "items",
				"index": 4
			},
 
		]/**SCHEMA_DIFF*/
	};
});

 

Hello,

How can i make this lookup multiselect?

Like 1

Like

1 comments

Hi All,

 

What is the functionality behind the cancel function in multi-select lookup config? I am looking for ways to apply cancel function in addCallBack() to exit from a condition.

 

Thanks

Anupama

Like 0

Like

0 comments
Show all comments

Hi Team,



I would like to set an alert based on validations in a Multi-select-lookup detail object.



I have replaced the Account object and added a new field UsrParentComapny which points to the Account object itself.



Now, account is added as a multiselect lookup detail object in a section.  I would like to setup validation based on the selected values in the multiselect lookup.



Validation Required:

if the user selects a company (Account) that is a parent company (UsrParentCompany of Account) then he can’t select the comapnies (Account) that has this UsrParentCompany, 

If he tries to select such company (Account) there will be a pop-up: “you can’t choose more than one daughter company"

 

I have provided a sample Multiselect Lookup of Products. similarly i have Account object as multiselect detail object in another section 



 

 

Kindly guide to achieve the validation.





Regards,

Bhoobalan P.

Like 0

Like

1 comments

Hi Bhoobalan,

 

In the addCallBack function from this instruction (Academy instruction on adding the multiselect lookup) the list of selected rows is formed in this part of code of the method:

 

this.selectedRows = args.selectedRows.getItems();

 

You need to debug this method and exclude those accounts from items that don't feat the conditions (it has a parent account selected as an account in your custom section). The check can be performed via a custom esq that refers to accounts and checks if the account is a daughter company or not (you will need to create such a esq query). And in case some of the items in selectedRows is not suitable it will be automatically removed from the selectedRows and the further logic won't be triggered for records that shouldn't be processed. So you will need to create a custom esq that will perform this check.

 

Best regards,

Oscar

Show all comments

I am using this add-on for the multi-select functionality: Multi-select text field setup for Creatio

 

Now I want to filter this multi select field by another lookup on the same page. This works fine when I'm using regular lookups and a business rule.

 

I tried to modify the example in the documentation by changing "Name" to the correct column name in my multi select lookup. Then i changed "Customer" to this.get(UsrLookup2). 

 

When lookup2 is filled in on my page and I then open the multi select one, I get no options to choose from in the selection box.

 

Does anyone know what I should change?

 

"filters": function() {
return Terrasoft.createColumnFilterWithParameter(
Terrasoft.ComparisonType.EQUAL,
"Name",
"Customer");
},

 

Like 0

Like

0 comments
Show all comments