locked
Find the entity type based on the GUID RRS feed

  • General discussion

  • Hi,

    I need to find the entity type based on the GUID.

    How do i do that with the CRM SDK ?

    I need some sample code.

    thanks.

    Thursday, September 2, 2010 9:16 AM

All replies

  • I think I already answered that question elsewhere... :)

    The answer remains the same : it is not possible...

     


    My blog : http://mscrmtools.blogspot.com

    All my tools on my new dedicated site: MSCRMTools Repository
    Thursday, September 2, 2010 9:26 AM
    Moderator
  • ok.

    Then any helpful tip on how to determine the entity ?

    Based on a list of entities maybe ...

    Thanks.

    Thursday, September 2, 2010 9:49 AM
  • If you have a predefined list of entity, you can try some SQL queries on each table to see if that match...

    Let say you will search against account, contact and lead, you could try the following

    SELECT COUNT(accountid) FROM accountbase where accountid = theId

    SELECT COUNT(contactid) FROM contactbase where contactid= theId

    SELECT COUNT(leadid) FROM leadbase where leadid= theId

    And see if it returns 0 or 1, if 1, you found the good entity


    My blog : http://mscrmtools.blogspot.com

    All my tools on my new dedicated site: MSCRMTools Repository
    Thursday, September 2, 2010 9:51 AM
    Moderator
  • thanks.

    And how do you perform SQL queries in your code ?

    I have not used any SQL queries with the CRM SDK today yet.

    Thursday, September 2, 2010 10:21 AM
  • This is not related to CRM SDK, it is related to ADO .Net
    My blog : http://mscrmtools.blogspot.com

    All my tools on my new dedicated site: MSCRMTools Repository
    Thursday, September 2, 2010 10:56 AM
    Moderator