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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Plugin Crm

(0) ShareShare
ReportReport
Posted on by 160

I am trying to change value of optionset field using plugin.

if (Membership.LogicalName == "cr456_memebrship")
{
Membership.Id = ((EntityReference)transection["cr456_membership"]).Id;

var MembershipCol = service.Retrieve(Membership.LogicalName, Membership.Id, new ColumnSet("cr456_memebrshipstatus"));

if (MembershipCol.Contains("cr456_memebrshipstatus"))
{
MembershipCol["cr456_memebrshipstatus"] = new OptionSetValue(1);

}

But this code is not working. 

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Can you please provide the full version of your code? Can you please also provide full registration parameters of your plugin step?

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    I hope you have registered your plugin step on pre-operation stage.

    If you have registered on post operation then you will need to use service.update to update the optionset value

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans