I have Custom Entity New_Entity , Which has OptionSet(New_Type) with Values Male and Female (id,100 and 101).
I want to read these values from C# , i need ids in c# code(100,101).
How can i read these values from CRM in C#, Please help
Thanks,
I have Custom Entity New_Entity , Which has OptionSet(New_Type) with Values Male and Female (id,100 and 101).
I want to read these values from C# , i need ids in c# code(100,101).
How can i read these values from CRM in C#, Please help
Thanks,
Hi ,
You an also write like below -
int? type = null; if (_entity.Attributes.Contains("New_Type")) { if (Convert.ToString(_entity.Attributes["New_Type"]) != "" && (_entity.Attributes["New_Type"] as OptionSetValue) != null) { type = (_entity.Attributes["New_Type"] as OptionSetValue).Value; } }
Hi,
You should be able to get the field value as follows-
var IndustryOptionSet= (OptionSetValueCollection)targetEntity["new_industry"];
if(IndustryOptionSet != null)
{
var IndustryValue = IndustryOptionSet.Value;
}
Hope this help.
Hi,
you can refer below post.
Multi select optionset
community.dynamics.com/.../282806
docs.microsoft.com/.../multi-select-picklist
Optionset
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... 290,263 Super User 2024 Season 2
Martin Dráb 228,112 Most Valuable Professional
nmaenpaa 101,148