Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Regarding Option Set Multiple Selection

Posted on by Microsoft Employee

2262.aaa.jpg

this is showing on adding web resouce html it  is not executing 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding Option Set Multiple Selection

    4011.ddd.jpg

    this is my whole number field, option set having 100,000,000 first value and then continous

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Regarding Option Set Multiple Selection

    Hi Manikanta,

    The values in the whole number field should be greater than 100000000 for them to be custom option set values.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding Option Set Multiple Selection

    no execution i changed the fields to whole number and single line

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Regarding Option Set Multiple Selection

    The problem is with the code.

    The option set values can only be whole numbers.

    The fields new_set should be a whole number field and new_set1 should be a text field.

    var selectedOption = parent.Xrm.Page.getAttribute("new_set").getValue(); //Get the whole number value                           
                                if (this.checked) {
                                    if (selectedOption == null)
                                        selectedOption = rvalue+"";
                                    else
                                        selectedOption = selectedOption + "," + rvalue
                                }
                                else {
                                    var tempSelected = rvalue + ",";
                                    if (selectedOption != null) {
                                        if (selectedOption.indexOf(tempSelected) != -1)
                                            selectedOption = selectedOption.replace(tempSelected, "");
                                        else
                                            selectedOption = selectedOption.replace(rvalue, "");
                                    }
                                }
                                parent.Xrm.Page.getAttribute("new_set").setValue(selectedOption); //Set the selected option set value which is a whole number to the field
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding Option Set Multiple Selection

    am i need to have any number field or can i use both single line of fields

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding Option Set Multiple Selection

    yes the code disappeared but the problem is no o/p

  • Verified answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Regarding Option Set Multiple Selection

    Hi Manikanta,

    Open your HTML web resource.

    It seems you have pasted your code into RichText editor, instead of the source. Make sure you paste the code under Source Tab in web resource editor.

    See the screen shot below.

    36360.1.PNG

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding Option Set Multiple Selection

    Hi gopalan what is the issue pls clarify

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding Option Set Multiple Selection

    i replaced as u said it havent executed and it just changed in the code form. why the code is displaying on the form( image 1)?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding Option Set Multiple Selection

    here new_op1 = option set

    new_set & new_set1  both r single line of texts. am i need to use whole number field in that html?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans