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)

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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
NeerajPawar Profile Picture

NeerajPawar 2

#2
jlattimer Profile Picture

jlattimer 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans