locked
Clear Data Query Cache CRM Online interaction with CRM SDK RRS feed

  • Question

  • I am trying to connect CRM Online instance from ASP.Net MVC page using CRM SDK.

    I placed all my CRM SDK operations in a Class library and referenced that into my Web application.  For example this is the code.

            private XrmServiceContext xrm;
            public Crm()
            {
                xrm = new XrmServiceContext("Xrm");
            }
    
            public Contact GetContact(string username)
            {
                var contacts = xrm.ContactSet.Where(p => (p.NickName == username)).ToList();
    
                if (contacts.Count > 0)
                    return contacts[0];
    
                return null;
            }

    Now in the web application config file - 

      <microsoft.xrm.client>
        <contexts>
          <add name="Xrm" type="Xrm.XrmServiceContext, NewApp" />
        </contexts>
        <services>
          <add name="Xrm" type="Microsoft.Xrm.Client.Services.OrganizationService, Microsoft.Xrm.Client" />
        </services>
      </microsoft.xrm.client>

    But I am getting same QUERY RESULTS even when data is being changed behind the CRM. I tried it for 15 mins and wanted to see to get updated contact. But still no new data is coming through.

    Can anyone help me out in fixing this caching problem to get new data every time I query CRM online?


    Thanks, Rami [ASP.Net MVP]

    Tuesday, April 15, 2014 4:09 PM