Find the entity type based on the GUID

Discussion Find the entity type based on the GUID

  • Thursday, September 02, 2010 9:16 AM
     
     

    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.

All Replies

  • Thursday, September 02, 2010 9:26 AM
    Moderator
     
     

    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 02, 2010 9:49 AM
     
     

    ok.

    Then any helpful tip on how to determine the entity ?

    Based on a list of entities maybe ...

    Thanks.

  • Thursday, September 02, 2010 9:51 AM
    Moderator
     
     

    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 02, 2010 10:21 AM
     
     

    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 02, 2010 10:56 AM
    Moderator
     
     
    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