Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set a lookup value to open in a new window or new tab.

(0) ShareShare
ReportReport
Posted on by 200

I am assuming I will need JS for this so could someone help me develop a web resource that targets a lookup and opens the lookup record in a new widow or tab on click.

function openLookupNewWindow(){

var options = {openInNewWindow: true};

var type = Xrm.Page.getAttribute("ic_regardingorganizationid").getValue()[0].id;

$("#customerid").children().find("span.ms-crm-Lookup-Item").click(function(){

Xrm.Utility.openEntityForm("account", type, null, options);

});

}

*This post is locked for comments

  • whatup Profile Picture
    whatup 200 on at
    RE: Set a lookup value to open in a new window or new tab.

    I am testing it by getting a different record to open than that of the value in the lookup. I can get the record to open the issue is with the new window not opening.

  • Aric Levin Profile Picture
    Aric Levin 30,188 Moderator on at
    RE: Set a lookup value to open in a new window or new tab.

    Hi whatup,

    Let's start but saying that this logic is not supported. You can not access or manipulate the dom either with JavaScript or JQuery, as Microsoft can make changes at any point in time and this will stop working.

    Saying that, the openEntityForm is find, however make sure that your code enters the function.

    I am not sure if you are looking for span.ms-crm-Lookup-Item or possible the button or div click event.

    Try to avoid manipulating the dom if you can.

    Hope this helps.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans