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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to get field optionset from entity reference ?

(0) ShareShare
ReportReport
Posted on by 403

How to get field optionset from entity reference ?

Thanks,

5277.category.png

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    This code is not correct, here you are trying get option set field from entity reference, if this option set is part of the opportunity entity, you need to first query opportunity entity using it's id and then you can fetch it. It should be something like below

    Entity opportunity=service.Retrieve("opportunity",optId,new ColumnSet(new String[]{"swo_category"}));

    int category=opportunity.GetAttributeValue<OptionSetValue>("swo_category").Value;

    Let me know if you are facing any issue.

    Thanks

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

News and Announcements

Season of Giving Solutions is Here!

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Shidin Haridas Profile Picture

Shidin Haridas 2

#2
Abdullah13 Profile Picture

Abdullah13 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans