CRM 2013 Open Advanced Find from Anywhere with Bookmarklet

Posted: July 25, 2014 in Dynamics CRM 2013, JavaScript

In a previous blog post of mine I explained how to add Advanced Find onto the Form Command Bar in CRM 2013, since the list view no longer stays open while on forms like they did in 2011, it can be difficult getting to advanced find sometimes.

In this blog post I will be taking the code from that blog post and converting the button into a browser bookmarklet so that we can launch advanced find from anywhere in CRM, including forms, views, dashboards, and solutions.

Just like the command bar button, this bookmarklet will automatically open advanced find to the entity you’re on if coming from a form or view, otherwise it will display the first entity by default.

The script for the bookmark is as follows:

javascript: var frame = $("iframe").filter(function () { return ($(this).css('visibility') == 'visible') }); var form = frame[0].contentWindow; var u = form.Mscrm.CrmUri.create("/main.aspx"); u.get_query()["pagetype"] = "advancedfind"; try { var etc = form.Xrm.Page.context.getQueryStringParameters().etc; } catch (e) { } if (etc) { u.get_query()["extraqs"] = "EntityCode=" + etc; } form.openStdWin(u, "_blank", 900, 600); void (0);

 

As you can see, from a contact form the Advanced Find bookmarklet opens a new window with advanced find defaulted to Contacts.

Now you don’t have to think about where you need to be to launch advanced find, as long as you’re inside CRM when you click the button it should take you right where you need to go!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s