web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Open Lookup record in new Window

(0) ShareShare
ReportReport
Posted on by

I have a lookup field on a form. I want to open the lookup record in a new window once i click the lookup field value instead of opening the record in the same window. Is there a way to achieve this? either out of box or custom code?

Can anyone help?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Refer this:

    www.magnetismsolutions.com/.../dynamics-crm-2013-2015-open-lookup-in-new-window-bookmarklet

    http://www.inogic.com/blog/2015/07/support-to-open-an-entity-form-in-a-new-window-in-dynamics-crm-2015-sp1/

  • Suggested answer
    Keerti Kodali Profile Picture
    50 on at

    You can place a button on the ribbon and call javascript by getting the lookup id and opening it in a new window.

    http://himbap.com/blog/?p=1473

    arunpotti.wordpress.com/.../get-lookup-id-text-entityname-in-crm-using-javascript

    msdn.microsoft.com/.../gg334266.aspx

    msdn.microsoft.com/.../jj602956.aspx

    community.dynamics.com/.../269569

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Rutul ,

    Please find javascript code - 

    function OpenLookupWindow() {
        if (Xrm.Page.getControl("lookupfieldName") != null && Xrm.Page.getControl("lookupfieldName").getAttribute().getValue() != null) {
            contactLookup = window.parent.Xrm.Page.getControl("lookupfieldName").getAttribute().getValue();
            lookupId = contactLookup[0].id;
            lookupName = contactLookup[0].name;
            var parameters = {};
           // parameters["attributename"] = "test"; //You can pass additional parameters if you want.
            var windowOptions = {
                openInNewWindow: false  // You can control the window 
            };  
            window.parent.Xrm.Utility.openEntityForm("EntityName", lookupId, parameters, windowOptions);   // Replace entity name here . If its not work try to remove "window.parent"  
    
        }
        else
        {
            alert("control not found");
        }
    }


  • Tony Woodhouse Profile Picture
    20 on at

    Goutam - thank you for your code snippet.  I had a similar problem to the OP and used your code to solve it.  Worked brilliantly.  Many thanks :-)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans