Skip to main content

Notifications

Announcements

No record found.

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. 

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Plugin Crm

    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

  • a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Plugin Crm

    Hello,

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

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,419 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,492 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans