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

Community site session details

Session Id :

Bookmarklets Updated

Henrik Gundersen Profile Picture Henrik Gundersen 978

Last year I posted a few bookmarklets that would help you quickly navigate around Dynamics CRM 2013 and do things like extracting the entity ID quickly when on an entity form, jumping straight to the solutions page etc. I have added a couple of quick commands to my toolbar this year and found a few new ones in the CRM community blogs. So here is an updated list.

For copying an entity identifier (will only work if on entity form)

javascript: if (window.prompt("EntityId:", $("iframe").filter(function () { return ($(this).css('visibility') == 'visible') })[0].contentWindow.Xrm.Page.data.entity.getId().slice(1, -1))) { }

For refreshing an entity asynchronously without reloading the page.

javascript:$("iframe").filter(function () { return ($(this).css('visibility') == 'visible') })[0].contentWindow.Xrm.Page.data.refresh(false)

For refreshing an entity asynchronously and saving all the data of the form without reloading the page.

javascript:$("iframe").filter(function () { return ($(this).css('visibility') == 'visible') })[0].contentWindow.Xrm.Page.data.refresh(true)

Enable all fields on the form and set submit mode to "always"

javascript:$("iframe").filter(function () { return ($(this).css('visibility') == 'visible') })[0].contentWindow.Xrm.Page.ui.controls.forEach(function(c, i){if (c && c.setDisabled) {c.setDisabled(false);}});$("iframe").filter(function () { return ($(this).css('visibility') == 'visible') })[0].contentWindow.Xrm.Page.data.entity.attributes.forEach(function(c, i){if (c && c.setSubmitMode) {c.setSubmitMode('always');}});

Change all labels to schema names

javascript:$("iframe").filter(function () { return ($(this).css('visibility') == 'visible') })[0].contentWindow.Xrm.Page.ui.controls.forEach(function(c, i){c.setLabel(c.getName());});
javascript: var nav = new Object(); nav.uri = "/tools/Solution/home_solution.aspx?etc=7100&sitemappath=Settings|Customizations|nav_solution"; window.top.document.getElementById("navBar").control.raiseNavigateRequest(nav); void (0)
javascript: var nav = new Object(); nav.uri = "/tools/Admin/admin.aspx?sitemappath=Settings|System_Setting|nav_administration"; window.top.document.getElementById("navBar").control.raiseNavigateRequest(nav); void (0)
javascript: var nav = new Object(); nav.uri = "/tools/business/business.aspx?sitemappath=Settings|Business_Setting|nav_businessmanagement"; window.top.document.getElementById("navBar").control.raiseNavigateRequest(nav); void (0)
javascript: var nav = new Object(); nav.uri = "/tools/servicemanagement/servicemanagement.aspx?sitemappath=Settings|Business_Setting|nav_servicemanagement"; window.top.document.getElementById("navBar").control.raiseNavigateRequest(nav); void (0)
javascript: var nav = new Object(); nav.uri = "/_root/homepage.aspx?etc=4703&pagemode=iframe&sitemappath=Settings|ProcessCenter|nav_workflow"; window.top.document.getElementById("navBar").control.raiseNavigateRequest(nav); void (0)
javascript:window.open($('#crmContentPanel iframe:not([style*=\"visibility: hidden\"])')[0].contentWindow.Xrm.Page.context.getClientUrl() + "/tools/AdminSecurity/adminsecurity_area.aspx");

Populate all required fields with MIN value (http://www.magnetismsolutions.com/blog/ahmed-anwar's-blog/2014/12/08/microsoft-dynamics-crm-2013-populating-required-fields-with-bookmarklets)

javascript:var form=$("iframe").filter(function(){return"visible"==$(this).css("visibility")})[0].contentWindow,attrs=form.Xrm.Page.data.entity.attributes.get();for(var i in attrs){var attr=attrs[i],contrs=attr.controls.get();if("required"==attr.getRequiredLevel())switch(attr.getAttributeType()){case"memo":attr.setValue("memo");break;case"string":attr.setValue("string");break;case"boolean":attr.setValue(!1);break;case"datetime":var today=new Date;attr.setValue(today);break;case"decimal":attr.setValue(attr.getMin());break;case"double":attr.setValue(attr.getMin());break;case"integer":attr.setValue(attr.getMin());break;case"lookup":attr.setValue(0);break;case"money":attr.setValue(attr.getMin());break;case"optionset":var options=attr.getOptions();attr.setValue(options[0].value)}}

Populate all required fields with MAX value (http://www.magnetismsolutions.com/blog/ahmed-anwar's-blog/2014/12/08/microsoft-dynamics-crm-2013-populating-required-fields-with-bookmarklets)

javascript:var form=$("iframe").filter(function(){return"visible"==$(this).css("visibility")})[0].contentWindow,attrs=form.Xrm.Page.data.entity.attributes.get();for(var i in attrs){var attr=attrs[i],contrs=attr.controls.get();if("required"==attr.getRequiredLevel())switch(attr.getAttributeType()){case"memo":attr.setValue("memo");break;case"string":attr.setValue("string");break;case"boolean":attr.setValue(!1);break;case"datetime":var today=new Date;attr.setValue(today);break;case"decimal":attr.setValue(attr.getMax());break;case"double":attr.setValue(attr.getMax());break;case"integer":attr.setValue(attr.getMax());break;case"lookup":break;case"money":attr.setValue(attr.getMax());break;case"optionset":var options=attr.getOptions();attr.setValue(options[0].value)}}

Show record properties

javascript:!function(){var t=$("iframe").filter(function(){return"visible"==$(this).css("visibility")})[0].contentWindow,e=t.Xrm.Page.data.entity.getId(),i=t.Xrm.Page.context.getQueryStringParameters().etc;t.Mscrm.RibbonActions.openFormProperties(e,i)}();

This was originally posted here.

Comments

*This post is locked for comments