I have created a function that opens a specific entity form and activates with a onchange event of a button. It works fine for my phonecall entity but crashes on my Annotation entity. The code is as follows:
function runShowTelephoneQuickView() {
if (Xrm.Page.data.entity.attributes.get("new_contactopgenomenvia").getValue() == "100000000") //telefoon
{
Xrm.Utility.openEntityForm("phonecall", null, {_CreateFromId: Xrm.Page.data.entity.getId(), _CreateFromType: Xrm.Page.context.getQueryStringParameters().etc, partyid: Xrm.Page.data.entity.getId(), partyname: Xrm.Page.data.entity.getPrimaryAttributeValue(), partytype: Xrm.Page.context.getQueryStringParameters().etc, pId: Xrm.Page.data.entity.getId(), pName: Xrm.Page.data.entity.getPrimaryAttributeValue(), pType: Xrm.Page.context.getQueryStringParameters().etc}, {openInNewWindow: true})
}
else if (Xrm.Page.data.entity.attributes.get("new_contactopgenomenvia").getValue() == "100000001" || Xrm.Page.data.entity.attributes.get("new_contactopgenomenvia").getValue() == "100000002")
{
Xrm.Utility.openEntityForm("annotation");
}
}
It crashes on the red part.
The error I am getting:

The error message is in dutch but it (roughly) says Error, there has been an error. Usually I get some kind of error log with what went wrong but this isn't available..
Using Dynamics 365 Online version 1612 (9.0.0.32.92) (DB 9.0.0.3292)
*This post is locked for comments
I have the same question (0)