Alex
Alex

Reputation: 163

MS CRM 2011 open lookup dialog with custom View from asp.net website

I have an asp.net website, which is included as an iframe on a form of an entity. On the website is a button. If I click the button, a crm lookup dialog will be shown.

This works very well, but now I need to open the same lookup with a custom View which i will create at runtime.

I know how to build a custom view and bind it to an existing crm lookup field:

Xrm.Page.getControl(lookupFieldId).addCustomView(viewId, entityName, 
    viewDisplayName, fetchXml, layoutXml, viewIsDefault);

But it's not a field on the crm form, its a button on my asp.net website.

What am I doing wrong?

Upvotes: 1

Views: 1743

Answers (1)

Alex
Alex

Reputation: 163

I solved my problem:

With window.parent I get the CRM level. Now I can call a Lookup with LookupObjects:

window.parent.LookupObjects(null, "single", typeCode, 0, null, "", null, 
    null, null, null, null, null, viewId, [customView]);

Upvotes: 1

Related Questions