Finding all Local Data Groups for CRM 4.0 Outlook Client (statuscode and statecodes) RRS feed

  • Question

  • I am trying to query the UserQuery view and am noticing some oddities.  QueryType of 16 is the Local Data Groups used by the CRM 4.0 Outlook Client.  Here is my SQL statement:

    SELECT     OwnerIdName, Name, FetchXml, StateCode, StatusCode
    FROM         UserQuery
    WHERE     (QueryType = 16)

    Some of the Local Data Groups returned by my above query do not show up in the end-user's Outlook Client.

    I'm seeing the following combinations of StateCode and StatusCode in the returned data:

    0 and NULL

    0 and 1

    1 and 2

    I know that a 0 StateCode indicates an active Local Data Group and 1 indicates an inactive Local Data Group.  What does the NULL and 1 indicate in the StatusCode field?

    Can someone please provide the correct SQL SELECT statement to get all Local Data Groups?

    Thursday, July 2, 2009 7:11 PM


All replies

  • Hi,
    your query looks to be right. You probably don't see queries for entities that are not enabled to be shown in Outlook when offline.

    0/null - enabled
    0/1 - after enabling
    1/2 - disabled
    Thursday, July 2, 2009 8:13 PM
  • Thanks for the feedback.  That's a good point, I'll see if the entities that the queries reference are enabled for offline use.  Can you please explain the difference between the "enabled" and "after enabling" UserQuery statuses?
    Monday, July 6, 2009 12:11 PM
  • After changing query status from Disabled to Enabled values are set to 0/1. 0/null are set by default.
    Monday, July 6, 2009 12:17 PM
  • Sorry, I'm a little slow.  Correct me if I'm wrong:

    0/null - Local Data Group is active
    0/1 - Local Data Group is active but had been inactivated at some point
    1/2 - Local Data Group is disabled
    Monday, July 6, 2009 8:13 PM
  • I think that's the way it's working.
    • Marked as answer by Jim Glass Jr Thursday, July 9, 2009 8:04 PM
    Monday, July 6, 2009 8:20 PM
  • I found the reason behind some of my end users not seeing the local data groups in the Outlook Client even though they queries show up in the UserQuery table.  Their CRM role is setup so that they aren't able to access the entities that the local data group queries.

    Anyone have an idea of how to modify the SELECT statement to factor in the roles and only display the UserQueries that the end user actually has rights to view the entities?

    Monday, July 6, 2009 8:29 PM