Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Set Optionset values in case form on basis of select customer profile field

Posted on by 15

I have a requirement in which on case form I have a option-set and the values of this option-set should be set on basis of selected customer entity. For example, in Person enity I have fields EmailAdress1, EmailAddress2 and EmailAddress3, so now when I create case on that customer then on Case form in an optionset I need to show values of these three fields.

  • Suggested answer
    RE: Set Optionset values in case form on basis of select customer profile field

    Hello Muhammad,

    If I understood correctly, you need that the case created for that Person record has an option set field that contains the same value of the option set presnet in the person record.

    So if it is correct, I suggest to you to use a global option and map the two option set ( for Case and Person ) on this global option.

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/create-edit-global-option-sets

    Doing that will be easier when create the case, reading the value of the option set from the person and use the same for the case

    You can create the case from the person uisng something similar:

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/openform#example-2-open-an-entity-form-for-new-record

    To populate the option set field you can use something like:

    var entityFormOptions = {};
    entityFormOptions["entityName"] = "account";

    // Set default values for the Account form
    var formParameters = {};
    formParameters["new_customoption"] = 100000000; // need to use the value you have in the option

    // Open the form.
    Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
    function (success) {
    console.log(success);
    },
    function (error) {
    console.log(error);
    });

    Regards

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans