Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Open Lookup record in new Window

Posted on by Microsoft Employee

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

  • Tony Woodhouse Profile Picture
    Tony Woodhouse 20 on at
    RE: Open Lookup record in new Window

    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 :-)

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Open Lookup record in new Window

    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");
        }
    }


  • Suggested answer
    Keerti Kodali Profile Picture
    Keerti Kodali 50 on at
    RE: Open Lookup record in new Window

    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
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Open Lookup record in new Window

    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/

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans