locked
Unified Service desk - CustomerRecord' to type 'Microsoft.Crm.UnifiedServiceDesk.Dynamics.DynamicsCustomerRecord' RRS feed

  • Question

  • Hi,

    When i am trying to navigate to open contact i am getting the follow error.

    Does anyone gone htrough this kind of error?

    Source	: Microsoft.Crm.UnifiedServiceDesk.Dynamics
    Method	: GetContextReplacedString
    Date	: 3:43:45 PM
    Time	: 12/26/2014
    Error	: Unable to cast object of type 'SearchControl.CustomerRecord' to type 'Microsoft.Crm.UnifiedServiceDesk.Dynamics.DynamicsCustomerRecord'.
    Stack Trace	: at Microsoft.Crm.UnifiedServiceDesk.Dynamics.Utility.GetContextReplacedString(String inputString, Context CurrentContext, Session sessionContext, Dictionary`2 list)
       at Microsoft.Crm.UnifiedServiceDesk.Dynamics.CRMGlobalManager.ExecuteActions(Session session, List`1 actions, String showtab, Dictionary`2 parameters)
    ======================================================================================================================
    
    43:45.91 Microsoft.Crm.UnifiedServiceDesk.Dynamics Information: 8 : 43:45.91 Exception Generated in ExecuteActionsUnable to cast object of type 'SearchControl.CustomerRecord' to type 'Microsoft.Crm.UnifiedServiceDesk.Dynamics.DynamicsCustomerRecord'.
    43:45.91 Microsoft.Crm.UnifiedServiceDesk.Dynamics Information: 8 : 43:45.91 ActionCall: Name= Action=Navigate App=Contact Data= Condition= ConditionResult=ActionFailed Result=
    
    Thanks,


    Sreeni Pavalla

    Friday, December 26, 2014 10:21 AM

Answers

  • Hey Atul,

    I was passing retrieved customer info to opensession instead of dynamic customer.

    Create ddyamic customer record by passind record id like below. It will solve the issue.

    var cust = new DynamicsCustomerRecord(new EntityDescription { Id = contactId, LogicalName = "contact" });
                    cust.SessionName = customerFromCrm.FullName;
                    CustomerEntity sessionCustomer = null;
                    sessionCustomer = new CustomerEntity(contactId.ToString(), cust, "<CustomerID>1<CustomerID/>", false, this.ApplicationName);
    
                    sessionCustomer.IsNewCustomer = true;
    
                    // Start a new session
                    OpenSession(sessionCustomer, Guid.Empty);
    Let me know if you have more questions.


    Sreeni Pavalla

    Friday, February 6, 2015 1:14 PM

All replies

  • Hi Sreeni,

    I am also getting same error while opening customer record in new session from my custom wpf hosted control. If you are able to figure out the error, could you please share the solution for it.

    Thanks,

    Atul

    Friday, February 6, 2015 10:02 AM
  • Hey Atul,

    I was passing retrieved customer info to opensession instead of dynamic customer.

    Create ddyamic customer record by passind record id like below. It will solve the issue.

    var cust = new DynamicsCustomerRecord(new EntityDescription { Id = contactId, LogicalName = "contact" });
                    cust.SessionName = customerFromCrm.FullName;
                    CustomerEntity sessionCustomer = null;
                    sessionCustomer = new CustomerEntity(contactId.ToString(), cust, "<CustomerID>1<CustomerID/>", false, this.ApplicationName);
    
                    sessionCustomer.IsNewCustomer = true;
    
                    // Start a new session
                    OpenSession(sessionCustomer, Guid.Empty);
    Let me know if you have more questions.


    Sreeni Pavalla

    Friday, February 6, 2015 1:14 PM