[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/pabloperalta] Pablo Peralta's Blog

Hi,

I came across this problem when running a LINQ query through Dynamics CRM LINQ provider for getting the count of records returned by my query.

My query looked like this:

 

var lineItems = from lineItem in MyXrmServiceContext.OpportunityProductSet
                         where lineItem.OpportunityId.Id == opportunityId
                         select lineItem;
 
 if (lineItems != null && lineItems.Count() > 0)
 {
     foreach (OpportunityProduct lineItem in lineItemsToDelete)
     {
         //do something
     }
 }

 

Unfortunately this simple statement (lineItems.Count()) throws the following exception:

 

The method ‘Count’ is not supported

 

I have made some research and found some ways to workaround it by using FetchXml or RetrieveMultiple to get the count of records. Nevertheless, I discovered another workaround much simpler I guess that could perfectly work in case you are working with few records (I think it may be not so performant with relevant amount of records). The approach is just converting the IQueryable collection to a List, as shown below:

 

var lineItems = from lineItem in MyXrmServiceContext.OpportunityProductSet
                         where lineItem.OpportunityId.Id == opportunityId
                         select lineItem;
 
 if (lineItems != null && lineItems.ToList<OpportunityProduct>().Count() > 0)
 {
     foreach (OpportunityProduct lineItem in lineItemsToDelete)
     {
         //do something
     }
 }

 

Now, getting the count of records works like a charm for me Smile.

 

Hope it helps you in your developments,

 

PP [twitter: @pabloperalta]

UruIT Dynamix | Excellence in Dynamics CRM Nearshoring Services.

uruit_dynamix_016[2]

Hi,

I have just came across this exception when trying to execute the SaveChanges() method of my ServiceContext object in CRM 2011 (on-premise).

 

Exception:

"An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."

 

Inner Exception:

"An error occurred when verifying security for the message."

 

Unfortunately I couldn’t find so much useful information around about the InnerException, which I guess should be the first thing to search for. But, I did could find related info about the main Exception and realized that I was also having troubles to connect from my CRM Outlook client too. So, I suspected that it was something wrong with my machine but not the code, the code was right.

And that was true. The problem was my clock. As I have changed my time zone, time was not in synch with my CRM 2011 server.

 

Solution:

In my case, I just set up same time zone in my machine as the server is set up, adjusted the clock, F5 again and voila! SaveChanges() worked like a charm Smile

 

Hope it helps to save somebody else’s time,

PP [twitter: @pabloperalta]

UruIT Dynamix | Excellence in Dynamics CRM Nearshoring Services.

Hi,

I was developing a ConsoleApp to connect to my Dynamics CRM 2011 deployment and when tried to instantiate the ServiceContext of my Xrm model this way:

 

var crm = new MyXrm.MyXrmServiceContext("MSCRM");

 

I got the Exception:

A configuration element with the name 'MSCRM' under the 'contexts' collection does not exist.

 

In my App.config my key was set up like this:

<connectionStrings>
  <add name="MSCRM" connectionString="Authentication Type=AD;Server=http://myserver/myorg;User ID=mydomain\user;Password=pass" />
</connectionStrings>

 

Pretty odd as I have followed the steps stated here to create a Console App from scratch.

 

So, I searched for this exception and thanks to this article I realized that there were some sections missing from my App.config file in order to properly configure the Context.

 

Solution

Just add the following sections to your .config file:

 

<configSections>
 <section name="microsoft.xrm.client" type="Microsoft.Xrm.Client.Configuration.CrmSection, Microsoft.Xrm.Client"/>
</configSections>
<microsoft.xrm.client>
 <contexts>
  <add name="MSCRM" type="Xrm.XrmServiceContext, Xrm"/>
 </contexts>
</microsoft.xrm.client>

 

By adding those sections and running my App again, it worked like a charm!.

 

Hope it helps to save somebody else’s time,

 

PP [twitter: @pabloperalta]

UruIT Dynamix | Excellence in Dynamics CRM Nearshoring Services.

uruit_dynamix_01

Setting up Outlook client to work against a new Dynamics CRM 2011 IFD setup, I came across the following error:

image

Obviously my credentials were right and I had the proper certificates already installed. Everything worked fine through IE.

 

So, I turned on tracing by using the out of the box Diagnostics tool:

image

Tried again so I got the complete trace at:

C:\Users\<user>\AppData\Local\Microsoft\MSCRM\Traces

 

When opened the trace file I realized the true error:

 

…..

>Crm Exception: Message: Credentials required, ErrorCode: -2147220988
[2012-04-15 08:55:56.375] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread:   11 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Info | MiniDump.CreateDumpInternal
    at MiniDump.CreateDumpInternal(MiniDumpReasons reason, Exception exception)
    at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException, Boolean enableTrace)
    at ClaimsBasedAuthProvider`1.AuthenticateClaims()
    at ClaimsBasedAuthProvider`1.SignIn()
    at ClientAuthProvidersFactory`1.SignIn(Uri endPoint, Credential credentials, AuthUIMode uiMode, IClientOrganizationContext context, Form parentWindow, Boolean retryOnError)
    at DeploymentInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow, Credential credentials)
    at DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
    at DeploymentsInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow)
    at ServerForm.LoadOrganizations(Boolean forceUI)
    at ServerForm.<InitializeBackgroundWorkers>b__0(Object sender, DoWorkEventArgs e)
    at BackgroundWorker.OnDoWork(DoWorkEventArgs e)
    at BackgroundWorker.WorkerThreadStart(Object argument)
    at StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
    at StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
    at AgileAsyncWorkerItem.DoAsyncCall()
    at AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
    at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
    at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at ThreadPoolWorkQueue.Dispatch()
    at _ThreadPoolWaitCallback.PerformWaitCallback()
>MiniDump: TraceDirectory setting not set or missing. Defaulting to temporary folder.
[2012-04-15 08:55:56.376] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread:   11 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ClientAuthProvidersFactory`1.SignIn
    at ClientAuthProvidersFactory`1.SignIn(Uri endPoint, Credential credentials, AuthUIMode uiMode, IClientOrganizationContext context, Form parentWindow, Boolean retryOnError)
    at DeploymentInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow, Credential credentials)
    at DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
    at DeploymentsInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow)
    at ServerForm.LoadOrganizations(Boolean forceUI)
    at ServerForm.<InitializeBackgroundWorkers>b__0(Object sender, DoWorkEventArgs e)
    at BackgroundWorker.OnDoWork(DoWorkEventArgs e)
    at BackgroundWorker.WorkerThreadStart(Object argument)
    at StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
    at StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
    at AgileAsyncWorkerItem.DoAsyncCall()
    at AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
    at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
    at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at ThreadPoolWorkQueue.Dispatch()
    at _ThreadPoolWaitCallback.PerformWaitCallback()
>Silent sign-in failed and requested UiMode is silentonly. Failing authentication process.
[2012-04-15 08:55:56.376] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread:   11 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Error | DeploymentsInfo.InternalLoadOrganizations
    at DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
    at DeploymentsInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow)
    at ServerForm.LoadOrganizations(Boolean forceUI)
    at ServerForm.<InitializeBackgroundWorkers>b__0(Object sender, DoWorkEventArgs e)
    at BackgroundWorker.OnDoWork(DoWorkEventArgs e)
    at BackgroundWorker.WorkerThreadStart(Object argument)
    at StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
    at StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
    at AgileAsyncWorkerItem.DoAsyncCall()
    at AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
    at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
    at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at ThreadPoolWorkQueue.Dispatch()
    at _ThreadPoolWaitCallback.PerformWaitCallback()
>Exception during Signin Microsoft.Crm.CrmException: Credentials required
   at Microsoft.Crm.Outlook.ClientAuth.ClaimsBasedAuthProvider`1.AuthenticateClaims()
   at Microsoft.Crm.Outlook.ClientAuth.ClaimsBasedAuthProvider`1.SignIn()
   at Microsoft.Crm.Outlook.ClientAuth.ClientAuthProvidersFactory`1.SignIn(Uri endPoint, Credential credentials, AuthUIMode uiMode, IClientOrganizationContext context, Form parentWindow, Boolean retryOnError)
   at Microsoft.Crm.Application.Outlook.Config.DeploymentsInfo.DeploymentInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow, Credential credentials)
   at Microsoft.Crm.Application.Outlook.Config.DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
[2012-04-15 08:55:58.290] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread:   11 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | ClientAuthProvidersFactory`1.RetrieveUserCredentialsAndSignIn
    at ClientAuthProvidersFactory`1.RetrieveUserCredentialsAndSignIn(Uri endPoint, Credential credentials, Form parentWindow, Boolean retryOnError, IClientOrganizationContext context)
    at ClientAuthProvidersFactory`1.SignIn(Uri endPoint, Credential credentials, AuthUIMode uiMode, IClientOrganizationContext context, Form parentWindow, Boolean retryOnError)
    at DeploymentInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow, Credential credentials)
    at DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
    at DeploymentsInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow)
    at ServerForm.LoadOrganizations(Boolean forceUI)
    at ServerForm.<InitializeBackgroundWorkers>b__0(Object sender, DoWorkEventArgs e)
    at BackgroundWorker.OnDoWork(DoWorkEventArgs e)
    at BackgroundWorker.WorkerThreadStart(Object argument)
    at StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
    at StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
    at AgileAsyncWorkerItem.DoAsyncCall()
    at AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
    at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
    at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at ThreadPoolWorkQueue.Dispatch()
    at _ThreadPoolWaitCallback.PerformWaitCallback()
>Creating a client authentication form.
[2012-04-15 08:56:47.023] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread:   12 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ClientAuthProvider`1.HandleAuthenticationFailures
    at ClientAuthProvider`1.HandleAuthenticationFailures(Action method)
    at ClaimsBasedAuthProvider`1.AuthenticateClaims()
    at ClaimsBasedAuthProvider`1.SignIn()
    at ClientAuthProvidersFactory`1.HandleCredentialsEntered(Object sender, CredentialsEventArgs e)
    at ClientAuthForm.SignInAsync(Object value)
    at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
    at ExecutionContext.runTryCode(Object userData)
    at RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
    at ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at ThreadPoolWorkQueue.Dispatch()
    at _ThreadPoolWaitCallback.PerformWaitCallback()
>Exception when trying to authenticate:System.ServiceModel.Security.MessageSecurityException: The security timestamp is invalid because its creation time ('2012-04-15T12:05:07.838Z') is in the future. Current time is '2012-04-15T11:56:46.863Z' and allowed clock skew is '00:05:00'.

Server stack trace:
   at System.ServiceModel.Security.SecurityTimestamp.ValidateFreshness(TimeSpan timeToLive, TimeSpan allowedClockSkew)
   at System.ServiceModel.Security.SecurityTimestamp.ValidateRangeAndFreshness(TimeSpan timeToLive, TimeSpan allowedClockSkew)
   at System.ServiceModel.Security.ReceiveSecurityHeader.ReadTimestamp(XmlDictionaryReader reader)
   at System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader reader)
   at System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader, XmlDictionaryReader reader)
   at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)
   at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessageCore(Message& message, TimeSpan timeout)
   at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout)
   at System.ServiceModel.Security.SecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

….

 

So, I came to the point that it was something wrong with my clock, smelling like the ‘already typical’ issue with CRM Outlook client when there is a difference bigger than 5 minutes between server and client.

 

Solution

Once identified the actual problem, solution was pretty easy. Just adjusted my clock to be the same as server (timezone and time) and after that, I could successfully set up my Outlook client.

 

Hope it helps you out,

 

PP [twitter: @pabloperalta]

UruIT Dynamix | Excellence in Dynamics CRM Nearshoring Services.

Hi,

I want to share an odd exception I got today while trying a LINQ query within a Plugin through the LINQ query provider in Microsoft Dynamics CRM 2011.

 

When running the following query:

 

public static PriceLevel GetPriceLevel(string priceLevelName, IOrganizationService organizationService)
{
    var crm = new Xrm.MyXrmServiceContext(organizationService);
 
    var PriceLevelToreturn = crm.PriceLevelSet.Where(p => priceLevelName.ToLower().Equals(p.Name.ToLower()) ).FirstOrDefault();
 
    return PriceLevelToreturn;
}

 

.. I ran into the following Exception:

 

NotSupportedException: Invalid 'where' condition. An entity member is invoking an invalid property or method.

 

Nothing were wrong with the types I was comparing to. Everything seemed to be fine until I came up with this article that depicts some limitations regarding to the LINQ query provider in Microsoft Dynamics CRM 2011:

where

The left side of the clause must be an attribute name and the right side of the clause must be a value. You cannot set the left side to a constant. Both the sides of the clause cannot be constants.

Supports the String functions Contains, StartsWith, EndsWith, and Equals.

 

Really annoying and unknown up to this moment for me :( . So, based on these statements I had two wrong things in my query:

1. I was using the attribute at the right side and it should be located at the left (pretty curious why btw Smile with tongue out)

2. I was using .ToLower() method which seems no to be supported.

 

So, I had to correct the above couple of things and after that, my code looked like this:

 

public static PriceLevel GetPriceLevel(string priceLevelName, IOrganizationService organizationService)
{
    var crm = new Xrm.MyXrmServiceContext(organizationService);
 
    var PriceLevelToreturn = crm.PriceLevelSet.Where(p => p.Name.Equals(priceLevelName)).FirstOrDefault();
 
    return PriceLevelToreturn;
}

 

When running again, voila! Smile . LINQ query run successfully.

 

Hope it helps to save somebody else time,

 

PP [twitter: @pabloperalta]

UruIT Dynamix | Excellence in Dynamics CRM Nearshoring Services.

 

PS: Luckily in my case I didn’t actually need ToLower() in the end.

Hi,

My requirement was to register a plugin so that every time a file is attached to some entities, I download the file to a temp folder for performing some processing. Actually, in my case it was processing an Excel file as a more user-friendly data input for line items in opportunities and quotes, but that is anecdotic.

The 3 key points I would like to share here with you is how to:

  • Retrieve the note (annotation entity which is the one who stores the file)
  • Retrieve the file content
  • Save the file to a location in the web server

Below are some parts of my plugin .cs file:

 

//RETRIEVE THE NOTE

protected void ExecutePostNoteCreate(LocalPluginContext localContext)
{
    string tempFile = string.Empty;
 
    IPluginExecutionContext context = localContext.PluginExecutionContext;
    IOrganizationService organizationService = localContext.OrganizationService;         
    
    if (context.InputParameters.Contains("Target") &&
        context.InputParameters["Target"] is Entity)
    {
        Entity noteEntity = (Entity)context.InputParameters["Target"];
 
        Annotation note = noteEntity.ToEntity<Annotation>();
 
    .....

 

// RETRIEVE THE FILE CONTENT (DocumentBody property)

if (!string.IsNullOrEmpty(note.FileName))
{
   tempFile = SaveFile(note.FileName, note.DocumentBody);
}

 

// SAVE THE FILE

private static string SaveFile(string fileName, string noteBody)
{
    string outputFileName = @"C:\temp\" + fileName;
 
    if (!string.IsNullOrEmpty(noteBody))
    {
        // Download the attachment in the current execution folder.
        byte[] fileContent = Convert.FromBase64String(noteBody);
        System.IO.File.WriteAllBytes(outputFileName, fileContent);
    }
    else
    {
        throw new InvalidPluginExecutionException("File content is empty or cannot be retrieved");
    }
 
    return outputFileName;
}

Take note I’m using System.IO.File.WriteAllBytes. This is what did work for me. I’ve tried using WriteAllText and also FileStream but when trying to open the generated file, it was not in the right format.

 

Hope it helps,

PP [twitter: @pabloperalta]

If you experience any error (i.e. an Access Denied) and have a related Object Type when you take a look at the error, you may wonder which entity corresponds to that Object Type.

 

There is a simple query that you can run on the organization DB to know all object types as well as other useful information about each entity. The query is:

SELECT * from EntityView
ORDER BY ObjectTypeCode

 

Nevertheless, unfortunately sometimes we are not granted direct access to production databases, so, we have to ask someone from the customer’s IT department to run it for us. That may take minutes, sometimes hours and in some cases..well…In CRM Online, on the other hand, we definitely won’t have it.

 

So, I’m sharing here the list of out of the box Object Types in order to make this finding easier:

1    Account
2    Contact
3    Opportunity
4    Lead
5    Annotation
6    BusinessUnitMap
7    Owner
8    SystemUser
9    Team
10    BusinessUnit
11    PrincipalObjectAccess
12    RolePrivileges
13    SystemUserLicenses
14    SystemUserPrincipals
15    SystemUserRoles
16    AccountLeads
17    ContactInvoices
18    ContactQuotes
19    ContactOrders
20    ServiceContractContacts
21    ProductSalesLiterature
22    ContactLeads
23    TeamMembership
24    LeadCompetitors
25    OpportunityCompetitors
26    CompetitorSalesLiterature
27    LeadProduct
28    RoleTemplatePrivileges
29    Subscription
30    FilterTemplate
31    PrivilegeObjectTypeCodes
32    SalesProcessInstance
33    SubscriptionSyncInfo
35    SubscriptionTrackingDeletedObject
36    ClientUpdate
37    SubscriptionManuallyTrackedObject
40    TeamRoles
41    PrincipalEntityMap
42    SystemUserBusinessUnitEntityMap
43    PrincipalAttributeAccessMap
44    PrincipalObjectAttributeAccess
112    Incident
123    Competitor
126    DocumentIndex
127    KbArticle
129    Subject
132    BusinessUnitNewsArticle
135    ActivityParty
150    UserSettings
1001    ActivityAttachment
1002    Attachment
1003    InternalAddress
1004    CompetitorAddress
1006    CompetitorProduct
1010    Contract
1011    ContractDetail
1013    Discount
1016    KbArticleTemplate
1017    LeadAddress
1019    Organization
1021    OrganizationUI
1022    PriceLevel
1023    Privilege
1024    Product
1025    ProductAssociation
1026    ProductPriceLevel
1028    ProductSubstitute
1030    SystemForm
1031    UserForm
1036    Role
1037    RoleTemplate
1038    SalesLiterature
1039    SavedQuery
1043    StringMap
1055    UoM
1056    UoMSchedule
1070    SalesLiteratureItem
1071    CustomerAddress
1072    SubscriptionClients
1075    StatusMap
1080    DiscountType
1082    KbArticleComment
1083    OpportunityProduct
1084    Quote
1085    QuoteDetail
1086    UserFiscalCalendar
1088    SalesOrder
1089    SalesOrderDetail
1090    Invoice
1091    InvoiceDetail
1111    SavedQueryVisualization
1112    UserQueryVisualization
1113    RibbonTabToCommandMap
1115    RibbonContextGroup
1116    RibbonCommand
1117    RibbonRule
1120    RibbonCustomization
1130    RibbonDiff
1140    ReplicationBacklog
1200    FieldSecurityProfile
1201    FieldPermission
1202    SystemUserProfiles
1203    TeamProfiles
2000    UserFiscalCalendar
2001    UserFiscalCalendar
2002    UserFiscalCalendar
2003    UserFiscalCalendar
2004    UserFiscalCalendar
2010    Template
2011    ContractTemplate
2012    UnresolvedAddress
2013    Territory
2020    Queue
2027    License
2029    QueueItem
2500    UserEntityUISettings
2501    UserEntityInstanceData
3000    IntegrationStatus
3231    ConnectionRole
3232    ConnectionRoleAssociation
3233    ConnectionRoleObjectTypeCode
3234    Connection
4000    Equipment
4001    Service
4002    Resource
4003    Calendar
4004    CalendarRule
4005    ResourceGroup
4006    ResourceSpec
4007    ConstraintBasedGroup
4009    Site
4010    ResourceGroupExpansion
4011    InterProcessLock
4023    EmailHash
4101    DisplayStringMap
4102    DisplayString
4110    Notification
4200    ActivityPointer
4201    Appointment
4202    Email
4204    Fax
4206    IncidentResolution
4207    Letter
4208    OpportunityClose
4209    OrderClose
4210    PhoneCall
4211    QuoteClose
4212    Task
4214    ServiceAppointment
4215    Commitment
4230    UserQuery
4250    RecurrenceRule
4251    RecurringAppointmentMaster
4299    EmailSearch
4300    List
4301    ListMember
4400    Campaign
4401    CampaignResponse
4402    CampaignActivity
4403    CampaignItem
4404    CampaignActivityItem
4405    BulkOperationLog
4406    BulkOperation
4410    Import
4411    ImportMap
4412    ImportFile
4413    ImportData
4414    DuplicateRule
4415    DuplicateRecord
4416    DuplicateRuleCondition
4417    ColumnMapping
4418    PickListMapping
4419    LookUpMapping
4420    OwnerMapping
4423    ImportLog
4424    BulkDeleteOperation
4425    BulkDeleteFailure
4426    TransformationMapping
4427    TransformationParameterMapping
4428    ImportEntityMapping
4500    RelationshipRole
4501    RelationshipRoleMap
4502    CustomerRelationship
4503    CustomerOpportunityRole
4567    Audit
4600    EntityMap
4601    AttributeMap
4602    PluginType
4603    PluginTypeStatistic
4605    PluginAssembly
4606    SdkMessage
4607    SdkMessageFilter
4608    SdkMessageProcessingStep
4609    SdkMessageRequest
4610    SdkMessageResponse
4611    SdkMessageResponseField
4613    SdkMessagePair
4614    SdkMessageRequestField
4615    SdkMessageProcessingStepImage
4616    SdkMessageProcessingStepSecureConfig
4618    ServiceEndpoint
4700    AsyncOperation
4702    WorkflowWaitSubscription
4703    Workflow
4704    WorkflowDependency
4705    IsvConfig
4706    WorkflowLog
4707    ApplicationFile
4708    OrganizationStatistic
4709    SiteMap
4710    ProcessSession
4800    WebWizard
4802    WizardPage
4803    WizardAccessPrivilege
4810    TimeZoneDefinition
4811    TimeZoneRule
4812    TimeZoneLocalizedName
7100    Solution
7101    Publisher
7102    PublisherAddress
7103    SolutionComponent
7105    Dependency
7106    DependencyNode
7107    InvalidDependency
8000    Post
8001    PostRole
8002    PostRegarding
8003    PostFollow
8005    PostComment
8006    PostLike
9100    Report
9101    ReportEntity
9102    ReportCategory
9103    ReportVisibility
9104    ReportLink
9105    TransactionCurrency
9106    MailMergeTemplate
9107    ImportJob
9333    WebResource
9502    SharePointSite
9508    SharePointDocumentLocation
9600    Goal
9602    GoalRollupQuery
9603    Metric
9604    RollupField
10021    msdyn_PostAlbum
10022    msdyn_PostConfig
10023    msdyn_PostRuleConfig

Hope you find it helpful!.

PP [twitter: @pabloperalta]

I want to share a quick tip that learned today.

 

Within Deployment Manager, when we double click an Organization we have this data available to see (or edit if organization is disabled):

image

What happens if we want to know exactly which SQL Server Database corresponds to each organization? Normally their names matches but sometimes (as happened today to me) it doesn’t ;).

So, the quick tip is querying Organization table from MSCRM_CONFIG database in order to find out this information.

 

By running this query within MSCRM_CONFIG database we should be able to easily identify each organization:

SELECT [DatabaseName]
      ,[FriendlyName]
      ,[SqlServerName]
      ,[SrsUrl]
      ,[State]
      ,[UniqueName]
      ,[UrlName]
      ,[IsDeleted]
  FROM [MSCRM_CONFIG].[dbo].[Organization]

 

(result)

image

 

Hope you find this helpful,

PP [twitter: @pabloperalta]

Hi,

I came up with this error recently, each time I clicked on ‘'What’s new’ menu option:

clip_image001

[Solution]

I am describing here what worked for me:

First, double check that OData end-point is working properly from Settings->Developer Resources->Organization Data Service.

clip_image001[6]

If an XML is returned, then.. next step is to double check you have ‘Activity Feeds’ Security Role assigned to you or the user is facing the problem. You can do this by navigating to Settings->Administration->Users->(click on the user)->Roles

image

After adding this role to the user, feeds under What’s new should be displayed successfully.

 

Hope it helps,

PP [twitter: @pabloperalta]

Hi,

I experienced this error today in a customer. No users could log in to CRM. Everything was working fine until yesterday :(

So, it was a bit strange but the error message was not so helpful. Anyway, I found a solution that worked for me and decided to share here:

 

[ERROR]

image

 

Eventlog:

COMException

The server is not operational. at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_NativeObject() at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args) at Microsoft.Crm.SecurityUtils.CheckMembership(Guid principalId, Guid groupId) at Microsoft.Crm.Caching.OrganizationSettingsCacheLoader.LoadCacheData(Guid key, ExecutionContext context) at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context) at Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context) at Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context) at Microsoft.Crm.BusinessEntities.SecurityLibrary.IsOrganizationSpecialUser(Guid organizationId, Guid userId, ExecutionContext context) at Microsoft.Crm.Caching.UserDataCacheLoader.LoadCacheData(Guid key, ExecutionContext context) at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context) at Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context) at Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context) at Microsoft.Crm.BusinessEntities.SecurityLibrary.GetUserInfoCommon(IOrganizationContext context, Guid userGuid) at Microsoft.Crm.BusinessEntities.SecurityLibrary.GetCallerAndBusinessGuidsFromThread(WindowsIdentity identity, Guid organizationId) at Microsoft.Crm.Authentication.CrmWindowsIdentity..ctor(WindowsIdentity innerIdentity, Boolean publishCrmUser, Guid organizationId) at Microsoft.Crm.Authentication.WindowsAuthenticationProviderBase.Authenticate(HttpApplication application, WindowsIdentity userIdentity) at Microsoft.Crm.Authentication.AuthenticationStep.Authenticate(HttpApplication application) at Microsoft.Crm.Authentication.AuthenticationPipeline.Authenticate(HttpApplication application) at Microsoft.Crm.Authentication.AuthenticationEngine.Execute(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Log file:

>System.Runtime.InteropServices.COMException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #15A4EDFA: System.Runtime.InteropServices.COMException (0x8007203A): The server is not operational.
>
>   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
>   at System.DirectoryServices.DirectoryEntry.Bind()
>   at System.DirectoryServices.DirectoryEntry.get_NativeObject()
>   at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
>   at Microsoft.Crm.SecurityUtils.CheckMembership(Guid principalId, Guid groupId)
>   at Microsoft.Crm.Caching.OrganizationSettingsCacheLoader.LoadCacheData(Guid key, ExecutionContext context)
>   at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context)
>   at Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context)
>   at Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context)
>   at Microsoft.Crm.BusinessEntities.SecurityLibrary.IsOrganizationSpecialUser(Guid organizationId, Guid userId, ExecutionContext context)
>   at Microsoft.Crm.Caching.UserDataCacheLoader.LoadCacheData(Guid key, ExecutionContext context)
>   at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context)
>   at Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context)
>   at Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context)
>   at Microsoft.Crm.BusinessEntities.SecurityLibrary.GetUserInfoCommon(IOrganizationContext context, Guid userGuid)
>   at Microsoft.Crm.BusinessEntities.SecurityLibrary.GetCallerAndBusinessGuidsFromThread(WindowsIdentity identity, Guid organizationId)
>   at Microsoft.Crm.Authentication.CrmWindowsIdentity..ctor(WindowsIdentity innerIdentity, Boolean publishCrmUser, Guid organizationId)
>   at Microsoft.Crm.Authentication.WindowsAuthenticationProviderBase.Authenticate(HttpApplication application, WindowsIdentity userIdentity)
>   at Microsoft.Crm.Authentication.AuthenticationStep.Authenticate(HttpApplication application)
>   at Microsoft.Crm.Authentication.AuthenticationPipeline.Authenticate(HttpApplication application)
>   at Microsoft.Crm.Authentication.AuthenticationEngine.Execute(Object sender, EventArgs e)
>   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
>   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
[2011-12-21 13:57:01.052] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:  151 |Category: Pla

 

[CAUSE]

After going over the logs and making some researches, finally all pointed out to something wrong with the Active Directory Domain Controller.

Actually, after searching hard I came up with this post from Customer Effective guys who confirmed my theory.

End of story: the problem was that one DC was down.

 

[SOLUTION]

Amazingly, solution was same as my previous post, but now for the CRM Server.

The idea of explicitly set the Preferred DC for Dynamics CRM worked fine, replacing previous value in the registry for the new one.

So, steps are:

  • Open registry and navigate to HKLM\Software\Microsoft\MSCRM
  • If "PreferredDc" string exists, then open it, if not
    • Right Click and click on NewString value as "PreferredDc"
  • Add / Edit the value to PreferredDc setting it to YourNewDomainControllerName. You can find this in your AD by typing the command in your cmd prompt echo %logonserver%

Hope it helps to save somebody else’s time,

PP [twitter: @pabloperalta]

More Posts Next page »