Tech Support > Microsoft Windows > Windows CRM > How to find ObjectTypeCode in ISV-Config
How to find ObjectTypeCode in ISV-Config
Posted by Per on June 12th, 2008


In 4.0 I have a custom entity ‘new_changerequest’ with a 1:N relationship to
Account, i.e. Account -> new_changerequest. On the Account form I have a
button defined in ISV-Config to create a new new_changerequest:

<Button Icon="/_imgs/ico_18_4412.gif" JavaScript="
var oId=crmForm.ObjectId;
var newwindow =
window.open('/userdefined/edit.aspx?_CreateFromType=1&_CreateFromId='+ oId +
'&etc=10008#',
'_blank','left=20,top=20,width=880,height=600,tool bar=0,status=1,resizable=1');"
Client="web,Outlook" AvailableOffline="true">
</Button>

My problem is that the ObjectTypeCode of new_changerequest (10008) may/will
change when ISV-Config is moved from development to production, i.e. the
value 10008 may in production be something else. I therefore want to be able
to create that value dynamically, but haven’t found a way to do so.

If the relationship was the other way around, it wouldn’t be a problem (use
lookup), neither if this was in a plugin, where I can access the metadata.
But in ISV-Config I believe I have to do this from Javascript and haven’t
figured out how-to.

--
Best regards,
Per

Posted by Michael Höhne on June 14th, 2008


The object type code is available in crmForm.ObjectTypeCode, but you can
also use the "etn" parameter, which takes the entity type name instead. So
Instead of etc=10008 you can specify etn=my_entity. The etn parameter is new
in CRM 4.0, so it does not apply to CRM 3.0.

--
Michael Höhne, Microsoft Dynamics CRM MVP

CRM Blog: http://www.stunnware.com/?area=blog

----------------------------------------------------------

"Per" <Per@discussions.microsoft.com> schrieb im Newsbeitrag
news:C4FF6F01-D4D1-4443-8749-0CDA88865982@microsoft.com...



Similar Posts