tag:blogger.com,1999:blog-8146380276624782495.post4993324391466021534..comments2024-03-07T22:48:09.509-08:00Comments on MS CRM Customization: Convert Option set to multi select Checkbox listMahadeo Matrehttp://www.blogger.com/profile/01395061256837112349noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-8146380276624782495.post-77462255505777887452022-02-22T07:53:55.788-08:002022-02-22T07:53:55.788-08:00Great! It works! However the option set field cann...Great! It works! However the option set field cannot be used in the advanced search but remains empty. How can this be solved? Thank youAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-11360891955856791582017-09-18T07:52:45.638-07:002017-09-18T07:52:45.638-07:00Thanks this working for me.... :)Thanks this working for me.... :)Anonymoushttps://www.blogger.com/profile/02670865177082138209noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-58202218008244016562017-06-21T09:43:53.449-07:002017-06-21T09:43:53.449-07:00Hi,
did you published your changes, also you can ...Hi, <br />did you published your changes, also you can add debugger and check is JavaScript is executing or not. Mahadeo Matrehttps://www.blogger.com/profile/01395061256837112349noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-48609854049068590252017-06-21T09:41:56.467-07:002017-06-21T09:41:56.467-07:00To store data on server you need to save record. T...To store data on server you need to save record. This code is not saving record. Mahadeo Matrehttps://www.blogger.com/profile/01395061256837112349noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-50976534230965149482017-06-19T04:57:46.431-07:002017-06-19T04:57:46.431-07:00pls rply regarding this pls rply regarding this Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-22063148034910569282017-06-19T04:42:40.365-07:002017-06-19T04:42:40.365-07:00i followed s u said but no execution, no error her...i followed s u said but no execution, no error here i just changed field names, added jquery, added web resource of html thats it is there anything to do.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-30627416163208815312017-05-01T16:02:09.689-07:002017-05-01T16:02:09.689-07:00Hello Mahadeo.
Thank you for this code. It has h...Hello Mahadeo. <br /><br />Thank you for this code. It has helped me immensely. However, I noticed that the data is not actually stored on the server and every time I refresh the page, the checks disappear in the check boxes. Do you have an solution or would it require editing Dynamics 365 through visual studio? <br /><br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-13847640100537511032017-02-09T13:17:01.230-08:002017-02-09T13:17:01.230-08:00Okay so I finally got it working instead of this.c...Okay so I finally got it working instead of this.checked we need to use $('#checkbox').is(':checked') and it works like a charm.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-54310759456647226962017-02-09T12:56:44.412-08:002017-02-09T12:56:44.412-08:00I threw an alert to check what value was set to se...I threw an alert to check what value was set to selectedOption and it returns a null value. Looks like it doesnt go in to the if(this.checked) loop. Alert on (this.checked) returns undefined. Am not sure what I am doing wrong but cant get it to work :(<br /><br />Thank you so much for all your responses you have been very helpful, appreciate your time and all the helpAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-30496590200723976142017-02-09T07:35:45.244-08:002017-02-09T07:35:45.244-08:00You need to check what values are set
parent.Xrm...You need to check what values are set <br /><br />parent.Xrm.Page.getAttribute("new_selectedyears").setValue(selectedOption);<br /><br />or <br /><br />parent.Xrm.Page.getAttribute("new_selectedyeartext").setValue(selectedYear);<br /><br />Check what values are coming in selectedOption and selectedYear variables. <br />Also try for some other records. Mahadeo Matrehttps://www.blogger.com/profile/01395061256837112349noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-5887889639483137422017-02-09T07:17:21.751-08:002017-02-09T07:17:21.751-08:00Thank you sir! No errors now. Appreciate all the h...Thank you sir! No errors now. Appreciate all the help. But now I am trying to figure out why arent the fields populating when I select a check box. No errors though in the debugger. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-78468782565715628772017-02-08T13:22:56.501-08:002017-02-08T13:22:56.501-08:00Update code as follows for checkbox click event
...Update code as follows for checkbox click event<br /><br /> $(checkbox)<br /> .attr("value", rvalue)<br /> .attr("checked", isChecked)<br /> .attr("id", "id" + rvalue)<br /> .click(function () {<br /> //To Set Picklist Select Values<br /> var selectedOption = parent.Xrm.Page.getAttribute("new_selectedyears").getValue();<br /> <br /> if (this.checked) {<br /> if (selectedOption == null)<br /> selectedOption = rvalue+"";<br /> else<br /> selectedOption = selectedOption + "," + rvalue<br /> }<br /> else {<br /> var tempSelected = rvalue + ",";<br /> if (selectedOption != null) {<br /> if (selectedOption.indexOf(tempSelected) != -1)<br /> selectedOption = selectedOption.replace(tempSelected, "");<br /> else<br /> selectedOption = selectedOption.replace(rvalue, "");<br /> }<br /> }<br /> parent.Xrm.Page.getAttribute("new_selectedyears").setValue(selectedOption);<br /><br /><br /> //To Set Picklist Select Text<br /> var selectedYear = parent.Xrm.Page.getAttribute("new_selectedyeartext").getValue();<br /> if (this.checked) {<br /> if (selectedYear == null)<br /> selectedYear = rText+"";<br /> else<br /> selectedYear = selectedYear + "," + rText<br /> }<br /> else {<br /> var tempSelectedtext = rText + ",";<br /> if (selectedYear != null) {<br /> if (selectedYear.indexOf(tempSelectedtext) != -1)<br /> selectedYear = selectedYear.replace(tempSelectedtext, "");<br /> else<br /> selectedYear = selectedYear.replace(rText, "");<br /> }<br /> }<br /> parent.Xrm.Page.getAttribute("new_selectedyeartext").setValue(selectedYear);<br /><br /> })<br /> .appendTo(checkboxList);<br /><br />Mahadeo Matrehttps://www.blogger.com/profile/01395061256837112349noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-80322511559877917912017-02-08T11:45:34.834-08:002017-02-08T11:45:34.834-08:00One last question, the debugger shows this error n...One last question, the debugger shows this error now and I havent been able to resolve it.<br /> var tempSelected = rvalue + ",";<br /> if (selectedOption.indexOf(tempSelected) != -1)<br /><br />SCRIPT 5007:unable to get property 'indexof' of undefined or null reference<br /><br />I changed the code to:<br />var tempSelected = rvalue + ",";<br />if ($.inArray(selectedOption,tempSelected) != -1)<br /><br />But then it throws<br />SCRIPT 5007:unable to get property 'replace' of undefined or null reference<br />at:<br />selectedOption = selectedOption.replace(rvalue, "").<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-9139850248883220532017-02-08T09:18:53.114-08:002017-02-08T09:18:53.114-08:00Sir, you rock! Thank you so much. Appreciate all t...Sir, you rock! Thank you so much. Appreciate all the help!. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-1826957843782226622017-02-08T09:07:20.614-08:002017-02-08T09:07:20.614-08:00Hi,
You need to remove spaces in HTML tag
var ch...Hi, <br />You need to remove spaces in HTML tag<br /><br />var checkbox = "< input type='checkbox' name='r' / >" + rText + ""<br /><br />There are some extra space added before "input" and at the end. Also it might be label will not be shown for checkbox, so change this line as<br /><br />var checkbox = "< label> < input type='checkbox' name='r' / >" + rText + "< / label>"Mahadeo Matrehttps://www.blogger.com/profile/01395061256837112349noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-53027563010024919822017-02-08T08:30:23.104-08:002017-02-08T08:30:23.104-08:00Thank you Mahadeo, appreciate your help. I was abl...Thank you Mahadeo, appreciate your help. I was able to fix the error by looking at the debugger. But now the webresource shows the HTML code instead <br /><br />< input type='checkbox' name= 'r' / >< input type='checkbox' name= 'r' / >< input type='checkbox' name= 'r' / ><br /><br />No error in the debugger as well. Any help is appreciated.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-54329063935241330122017-02-07T13:22:30.086-08:002017-02-07T13:22:30.086-08:00Yes, it is compatible with CRM 2016.
Make sure you...Yes, it is compatible with CRM 2016.<br />Make sure you have Jquery library added to your form library, also add debugger and see where the error is coming. <br />It might be when you are getting option set values from CRM, your attribute name is different. <br />Mahadeo Matrehttps://www.blogger.com/profile/01395061256837112349noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-46565358905865198162017-02-07T12:22:39.824-08:002017-02-07T12:22:39.824-08:00Hi Mahadeo,
I have tried this solution in CRM 201...Hi Mahadeo,<br /><br />I have tried this solution in CRM 2016 on prem but it doesnt work. It just displays an empty webresource. Is this compatible with CRM 2016?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-24493473056528734742016-10-27T06:57:32.679-07:002016-10-27T06:57:32.679-07:00Hi,
Do you have function ConvertDropDownToCheck...Hi, <br /><br />Do you have function ConvertDropDownToCheckBoxList() in your code?<br />make sure there is not any other javascript error, it might be you are missing some brackets or some syntax error in javascript. <br />Mahadeo Matrehttps://www.blogger.com/profile/01395061256837112349noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-22950974276924127752016-10-26T13:58:56.859-07:002016-10-26T13:58:56.859-07:00Hello, I have done this the manual way and by impo...Hello, I have done this the manual way and by importing your solution, but I am getting the following error when my contact form loads.<br /><br />ReferenceError: ConvertDropDownToCheckBoxList is not defined<br />Unknownhttps://www.blogger.com/profile/16887926759451759780noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-58293579620062118472016-08-03T01:43:52.748-07:002016-08-03T01:43:52.748-07:00Hi Mahadeo Matre...
Thanks fro your solution ...
...Hi Mahadeo Matre...<br /><br />Thanks fro your solution ...<br /><br />1.how can I clear the un-check values in the below test field ?<br />2.When I check the values ,values is populating in the below field and when I un-check and check the same value also the values is populating again <br />How can I clear thisAnonymoushttps://www.blogger.com/profile/13574704006555526771noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-78728983948278975592016-08-03T00:35:33.196-07:002016-08-03T00:35:33.196-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/13574704006555526771noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-64384867241428744372016-07-19T15:44:35.820-07:002016-07-19T15:44:35.820-07:00To correct the InvalidType error change line
paren...To correct the InvalidType error change line<br />parent.Xrm.Page.getAttribute("new_selectedyeartext").setValue(selectedOption);<br />to<br />parent.Xrm.Page.getAttribute("new_selectedyeartext").setValue(selectedOption.toString());Darinhttps://www.blogger.com/profile/02189694398854959550noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-14226337476476975092016-06-23T11:51:13.585-07:002016-06-23T11:51:13.585-07:00I'm having some issues implementing this. I...I'm having some issues implementing this. I've added the field for the choice set, 2 seprate multi line text box fields [one for storing values, and one for storing text]. I added the html web resource [replacing with the name of my fields] and then added that web resource to the form. When I add the web resource to the form, it looks like it adds it as a new field. When I open up the form I see the choice set there, but its still a drop down. I'm not sure what I'm doing wrong. Anonymoushttps://www.blogger.com/profile/11000079772983634121noreply@blogger.comtag:blogger.com,1999:blog-8146380276624782495.post-28459154463152847022016-03-28T12:50:31.522-07:002016-03-28T12:50:31.522-07:00Thanks,
I was able to get it working using the man...Thanks,<br />I was able to get it working using the managed solution you provided, but when I check a box I get a Invalidtype error. <br /><br />Anonymousnoreply@blogger.com