Tag: Bookmarklet

{Bookmarklet} Refresh Form Data

{Bookmarklet} Refresh Form Data

Recently I was developing a plugin in which, whenever a record updated some of the fields were updated and for reflecting those fields I need to refresh the page. I was tired to refresh the page again and again.so I come up with a solution that would also increase productivity.

I made a small bookmarklet that will help me to refresh form data without refreshing the entire page.

Here is code

javascript: (function () { debugger;(document.querySelectorAll(‘iframe’)).forEach(function (frame, v) { if (frame.style.visibility !== ‘hidden’) { if (frame) { var Xrm = frame.contentWindow.Xrm; Xrm.Page.data.refresh(); alert(‘Form Data Refreshed…’) } else { alert(‘Entity form not detected’); } } }) })();

Note: Before using the above code please update single quotation mark.

For adding this bookmarklet on chrome , refer below link

https://crmdynamicsblog.wordpress.com/2016/06/10/bookmarklet-get-current-record-guid-from-crm-form/

Hope it’ll help someone.

 

{Bookmarklet} Get current record Guid from CRM form

{Bookmarklet} Get current record Guid from CRM form

Most of the time when we developed some new functionality in crm, we need current entity record GUID for debugging and checking our modification using advanced find , Odata query etc.

In this blog I am going to create a simple bookmarklet for getting current enity record GUID.

What is Bookmarklet?

A small software application stored as a bookmark in a web browser, which typically allows a user to interact with the currently loaded web page in some way.

(definition from google)

For more details on bookmarklet creation refer below link

http://code.tutsplus.com/tutorials/create-bookmarklets-the-right-way–net-18154

Let’s write a JavaScript code that we use for our bookmarklet.

javascript;
(function () {
(document.querySelectorAll(‘iframe’)).forEach(function (frame, v) {
if (frame.style.visibility !== ‘hidden’) {
if (frame) {
var Xrm = frame.contentWindow.Xrm;
prompt(“Copy GUID for the current record”, Xrm.Page.data.entity.getId());
} else {
alert(‘Entity form not detected’);
}

}
})
})();

Now add a new page on chrome from bookmark bar

2

In name give some meaning name like ‘GETID’ and in URL paste our JavaScript code

1

Now try this on Entity Form, we’ll get the GUID of current record.

GIF

 

That’s it. Hope it’ll help someone 🙂

Thanks for visiting my blog!!!