locked
Object Type Code of a custom entity RRS feed

  • Question

  • Hi

     

    Is there a way of finding out what the Object Type Code (OTC) is for a custom entity.  I know that for a system entity you can go to http://crmserver:5555/sdk/list.aspx (where crmserver is the URL of your CRM server) and find out what the OTC is for a system entity but how can you find out what it is for a custom one.

     

    The reason I am asking is that I am wanting to use CRM Extensions free counter plugin on a project I am working on and one of the requirements is that I need the OTC so that I can add counters to some of the custom entities I have created.

     

    Any advice would be most gratefully received.

     

    Many thanks,

     

    Douglas

    Thursday, September 11, 2008 9:47 AM

Answers

  • Many thanks for your swift reply.  Unfortunately I'm not a developer and so from what I could find out about the MetadataService I would have to create some sort of programme in order to retrieve the values I needed.  I may be wrong.

     

    Anyway, found a couple of easier ways to do this:

     

    1.  On the onLoad event for an entity add the following piece of JavaScript:

     

    Code Snippet
    alert('Object Type Code: ' + crmForm.ObjectTypeCode);

     

     

    This pops up an alert box with the Object Type Code.  A bit of a fiddle if you have to do this for a lot of custom entities but it does work.

     

    2.  Open up a record of the type whose Object Type Code you wish to find out.  Once the form has loaded press Ctrl-N on your keyboard.  This brings up a copy of the current form but this time it has the address bar exposed at the top of the screen.  If you then look at the URL of the page you will find that the Object Type Code is given at the end where it says, "&etc=xxxxx#", where xxxxx is the Object Type Code.

     

    Thanks again,

     

    Dougy

    Thursday, September 11, 2008 10:30 AM

All replies

  • You can use the metadataservice for retrieving the entity metadata, which contains object type code for the entity as well.

     

    Thursday, September 11, 2008 9:52 AM
  • Many thanks for your swift reply.  Unfortunately I'm not a developer and so from what I could find out about the MetadataService I would have to create some sort of programme in order to retrieve the values I needed.  I may be wrong.

     

    Anyway, found a couple of easier ways to do this:

     

    1.  On the onLoad event for an entity add the following piece of JavaScript:

     

    Code Snippet
    alert('Object Type Code: ' + crmForm.ObjectTypeCode);

     

     

    This pops up an alert box with the Object Type Code.  A bit of a fiddle if you have to do this for a lot of custom entities but it does work.

     

    2.  Open up a record of the type whose Object Type Code you wish to find out.  Once the form has loaded press Ctrl-N on your keyboard.  This brings up a copy of the current form but this time it has the address bar exposed at the top of the screen.  If you then look at the URL of the page you will find that the Object Type Code is given at the end where it says, "&etc=xxxxx#", where xxxxx is the Object Type Code.

     

    Thanks again,

     

    Dougy

    Thursday, September 11, 2008 10:30 AM
  • Hi Douglas,

     

    You can also obtain a custom entity's OTC using the same URL you use for system entities.  Remember that your entity name will start with the customisation's prefix i.e. "new_" if you haven't changed it.

    Thursday, September 11, 2008 11:25 AM