Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

The type initializer for 'System.ServiceModel.Diagnostics.TraceUtility' threw an exception.

$
0
0

hi everyone,

         i have the following code , in which i am trying to connect to crm and get all active cases

i also try with fetchxml but it throwing tha above error. any help will be appriciated.  thanks

here is my code 

static void Main(string[] args)
{
using (var service = Class1.GetCRMService())
{
if (service!=null)
{
QueryExpression queryactive = new QueryExpression
{
EntityName = "systemuser",
ColumnSet = { AllColumns = true },
Criteria = new FilterExpression
{
Conditions =
 {
 new ConditionExpression
 {
 AttributeName = "systemuserid",
 Operator = ConditionOperator.Equal,
Values = {currentDate}
 }
}
}
};

EntityCollection accountRecord = service.RetrieveMultiple(queryactive);

}

var fetchXmlLoggedUserInTeam = @"
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
<entity name='systemuser'>
<attribute name='systemuserid' />
<link-entity name='teammembership' from='systemuserid' to='systemuserid' visible='false' intersect='true'>
<link-entity name='team' from='teamid' to='teamid' alias='ac'>
<filter type='and'>
<condition attribute='teamid' value='{D6AE0AAB-D60A-E711-9401-0050569B1EE7}' uitype='team' uiname='Tier-1 Helpline Email' operator='eq'/>

</filter>
</link-entity>
</link-entity>
</entity>
</fetch>";
//EntityCollection accountRecord = service.RetrieveMultiple(fetchXmlLoggedUserInTeam);
//var totalModeified = service.RetrieveMultiple(fetchXmlLoggedUserInTeam);
//var users = service.RetrieveMultiple(new FetchExpression(string.Format(
// fetchXmlLoggedUserInTeam,
// teamEntityReference.Id))).Entities;
}
}


Viewing all articles
Browse latest Browse all 79901

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>