locked
How to get entity code using Filtered Views RRS feed

  • Question

  • Hello,

    I am not able to find any information in SDK about the supported way to get entity code (Account=1, Contact=2, etc) using SQL and Filtered Views.

    I am trying to achive something like this:

    SELECT
    [ObjectTypeCode] FROM [EntityView] WHERE [Name] = 'invoice'

    The query actually works, but only for system administrators.

    Thank You in advance
    Monday, July 27, 2009 3:55 PM

Answers

  • Hi,

    As Karlo said. You can try to give read access to Entity in the customisations tab of the security role. This will only work for CRM users.

    An alternative is to cache this data when your application loads using admin credentials. Then all users will be able to access this cache without needing to access CRM and it will be much faster.

    Hope this helps.
    Monday, July 27, 2009 5:17 PM

All replies

  • Hi Jevgenij,

    You're selecting from a filteredview, as such normal MS CRM security will apply. The person performing the search will need read access to all records in the [EntityView]. If you try search using any non-mscrm user it will fairl entirely.

    HiH,
    Karlo
    Karlo Swart - http://www.ver206.com
    Monday, July 27, 2009 5:05 PM
  • Hi,

    As Karlo said. You can try to give read access to Entity in the customisations tab of the security role. This will only work for CRM users.

    An alternative is to cache this data when your application loads using admin credentials. Then all users will be able to access this cache without needing to access CRM and it will be much faster.

    Hope this helps.
    Monday, July 27, 2009 5:17 PM