Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

change option set field value based on security access

Posted on by 2,397

Hi, I have requirement that the option set value changes based on user security access, so that different user can see different value, how can I achieve that?

*This post is locked for comments

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: change option set field value based on security access

    Andrii provided some example there - basically, the idea would be to:

    - Check the user role name (here is another link: social.microsoft.com/.../get-security-role-name-using-javascript)

    - Use setValue on the option set

    - Probably use setSubmitMode('never') on the option set just to make sure it does not get submitted to the db

    And all that would have to happen in the onload of the form

  • sdnd2000 Profile Picture
    sdnd2000 2,397 on at
    RE: change option set field value based on security access

    It is readonly. But it should be displaying different value based on security roles

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: change option set field value based on security access

    Hi sdnd,

      how do you want it to work? If user A selects a value, and, then, user B goes to CRM.. should a new value be selected automatically? Since it will be saved to the database, what is supposed to happen when user A goes to CRM again?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: change option set field value based on security access

    Hello,

    The only way that's available now is scripting.

    Here is how you can change the list of values available - msdn.microsoft.com/.../gg334266.aspx

    Here is how you can get the list of roles available for user - msdn.microsoft.com/.../gg334511.aspx

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans