How to get field optionset from entity reference ?
Thanks,
*This post is locked for comments
How to get field optionset from entity reference ?
Thanks,
*This post is locked for comments
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156