web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Modify global option set from plugin

(0) ShareShare
ReportReport
Posted on by

Hello!

I have a custom Entity that contains a text attribute and a boolean attribute. I want to have a global option set with options that corresponds to records of this Entity that have true value of boolean attribute. I've created both entity and option set from my .net application. So as I see, my next step is to define behavior in next cases:

1) Record was updated. If boolean value was changed from true to false, I need to delete option from option set. If boolean value was changed from false to true, I need to add option to option set.

2) Record was created. If boolean attribute was set to true, I need to add option to option set.

3) Record was deleted. If boolean attribute was set to true, I need to delete option from option set.

Sounds like a plugin to me. But when trying to execute InsertOptionValueRequest or DeleteOptionValueRequest from plugin, it shoots an error (You cannot start a transaction with a different isolation level than is already set on the current transactionDetail)

Is it possible to change option set from plugin? And if it is, what am I doing wrong?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    " I want to have a global option set with options that corresponds to records of this Entity that have true value of boolean attribute"

    Why are you not using lookup?

    Changing OptionSet in runtime is bad design - OptionSet are suppose to be static data.

    Thanks,

    Prateek

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     try doing that outside of the original transaction (try pre-validate maybe.. or try an async plugin). And don't forget you'll need to publish those changes:

    msdn.microsoft.com/.../microsoft.crm.sdk.messages.publishallxmlrequest.aspx

    PS. As for the bad design.. I think it's all circumstantial:) Had to do exactly this with lookups/optionsets on two different projects.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans