Hi all
I have below code.
string MarketingListQuery = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
" <entity name='list'>" +
" <attribute name='createdfromcode' />" +
" <attribute name='listid' />" +
" <attribute name='aw_mailchimmarkettinglistid' />" +
" <order attribute='createdfromcode' descending='true' />" +
" <link-entity name='aw_mailchimp' from='aw_mailchimpid' to='aw_mailchimmarkettinglistid' alias='ac'>" +
" <filter type='and'>" +
" <condition attribute='aw_mailchimpid' operator='eq' uiname='test' uitype='aw_mailchimp' value='" + MailChimpId + "' />" +
" </filter>" +
" </link-entity>" +
" </entity>" +
"</fetch>";
EntityCollection MarketingListresult = service.RetrieveMultiple(new FetchExpression(MarketingListQuery));
foreach (var ColumnsMarketingList in MarketingListresult.Entities)
{
Entity contacttt = new Entity("contact");
contacttt["firstname"] = "Test";
contacttt["emailaddress1"] = "e@gmail.com";
var MarketingListMemberType = ColumnsMarketingList.GetAttributeValue < OptionSetValue > ("createdfromcode").ToString();
contacttt["lastname"] = MarketingListMemberType.ToString();
Guid contactIdddd = service.Create(contacttt);
if (MarketingListMemberType == "4")
{
}
}
My code does not giving me option set value. My code giving me this Microsoft.Xrm.Sdk.OptionSetValue. Where am I wrong? How can I get option value?
Thank You
*This post is locked for comments