Asked by:
Multiselect field error on CRM 2013

Question
-
Hi
I followed the instruction
https://community.dynamics.com/crm/f/117/t/135253.aspx
however, I m still having the following error:
There was an error with field's customized event.
Fields: crmForm
Event:onsave
Error: Object doesn't support property or method' saveMultiSelect
I did replace the scripts with the recent one.
Thanks in advance for you help
Eric
Wednesday, July 16, 2014 6:39 PM
All replies
-
Hi Eric,
As per the error, you are calling "saveMultiSelect" on save event of the form but this function does not exist in your code.
I have checked your code on given link. There is no method named "saveMultiSelect". It has onsave function which you need to call on save event.
HTH!- Proposed as answer by DynaDeveloper Thursday, July 17, 2014 12:26 PM
Thursday, July 17, 2014 12:26 PM -
I actually uploaded the solution in CRM from this website http://slalomdotcom.wordpress.com/2013/01/23/multi-select-option-sets-part-2/
and followed all the steps but I am still having this
"There was an error with field's customized event.
Fields: crmForm
Event:onsave
Error: Object doesn't support property or method' saveMultiSelect"
Now I did put the schema name of the two fields and every thing and still have the same error message.
Don't you think this part of the code might have something not quite right?
function saveMultiSelect() {
if (isDirty) {
var divElement = document.getElementById("MultiSelectField");
var result = '';for (var i = 0; i < divElement.childNodes.length; i++) {
if (divElement.childNodes[i].type == "checkbox" && divElement.childNodes[i].checked) {
result += divElement.childNodes[i].title + ";";
}
}
//clear out the previous results from the field
parent.Xrm.Page.getAttribute(var_sc_optionsetvalue).setValue("");
//populate var_sc_optionsetvalue with the checked values
parent.Xrm.Page.getAttribute(var_sc_optionsetvalue).setValue(result);
isDirty = false;
}
}</SCRIPT>
</BODY></HTML>Thank you
Eric
Thursday, July 17, 2014 5:58 PM -
I found out that I actually have that error message when I save a Lead from the Quick Create Shortcut button. If I create from the normal process, there's no error. How can I solve it?
Eric
Thursday, July 17, 2014 9:55 PM -
the quick create form contains the fields required for the multiselect and the webresource?
if they are not in the form try to add a check on the null condition after the getelementbyid
function saveMultiSelect() { if (isDirty) { var divElement = document.getElementById("MultiSelectField"); if (divElement != null) { var result = ''; for (var i = 0; i < divElement.childNodes.length; i++) { if (divElement.childNodes[i].type == "checkbox" && divElement.childNodes[i].checked) { result += divElement.childNodes[i].title + ";"; } } //clear out the previous results from the field parent.Xrm.Page.getAttribute(var_sc_optionsetvalue).setValue(""); //populate var_sc_optionsetvalue with the checked values parent.Xrm.Page.getAttribute(var_sc_optionsetvalue).setValue(result); isDirty = false; } } }
My blog: www.crmanswers.net - Rockstar 365 Profile
Thursday, July 17, 2014 10:05 PM -
It does not allow me to modify the code in the solution already uploaded.
also I am keeping getting this messages "error with XMLhttprequest"
Eric
Friday, July 18, 2014 8:23 PM -
you can extract the zip solution, made the change inside the file under the webresource folder (sc_MultiSelecthtm72FE770B-E60E-E211-94C3-08002733B87B) zip again the files and upload again the solution. or you can create a brand new webresources on your environment that contains the same code as the solution in order to be easier to modify them.
Note: it's not easy to debug this kind of solution remotely, if you have javascript errors you need to try to debug them by yourself as explained in this tutorial http://msdynamicscrmblog.wordpress.com/2013/12/20/dynamics-crm-2011-javascript-debugging-in-internet-explorer-11/
My blog: www.crmanswers.net - Rockstar 365 Profile
Friday, July 18, 2014 8:37 PM