Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Regarding Option Set

(0) ShareShare
ReportReport
Posted on by 100

I want to create new option set values dynamically, Is there any approach for that

I tried to use addOption(obj) method but dynamically created option are only available in UI side and Database couldn't add new created options

  • Pradnya Wankhade Profile Picture
    100 on at
    RE: Regarding Option Set

    13457.Capture.PNG

    I got this error when I will choose the newly added option from Option Set

  • Suggested answer
    meelamri Profile Picture
    13,212 User Group Leader on at
    RE: Regarding Option Set

    You can play with this PCF Control, try it.

    github.com/.../PCF-Controls

  • Pradnya Wankhade Profile Picture
    100 on at
    RE: Regarding Option Set

    I have tried same but, see all the added option are available on UI Side only In the database data couldn't added. Because of this getting error while storing the record

  • Pradnya Wankhade Profile Picture
    100 on at
    RE: Regarding Option Set

    Hi Thanks for responding on my post , can you please share any example so I can take as reference

  • vashti hatami Profile Picture
    40 on at
    RE: Regarding Option Set

    hi

    you can use this JS code:

    var low = {value : 100000000, text : "Low"};

       var medium = {value : 100000001, text : "Medium"};

       var high = {value : 100000002, text : "High"};

       var pickList = Xrm.Page.getControl("control_name");

       var options = pickList.getOptions();

       for (var i = 0; i < options.length; i++)

           pickList.removeOption(options[i].value);

       pickList.addOption(low);

       pickList.addOption(medium);

       pickList.addOption(high);

  • Verified answer
    meelamri Profile Picture
    13,212 User Group Leader on at
    RE: Regarding Option Set

    Hello,

    You can create a single line of text field and implement a PCF control to display the text field as an option Set.

    Another option is to use a webressource for the rendering, and you will store the selected value as a single line of text.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,099 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,884 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans