CANNOT SAVE MULTIPLE CHOICE FIELD VALUES FOR CREATIO
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
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?