Category Archives: MS CRM 2013 Web Resource

Creating html web resource to show image attached in Notes Part 2

In our previous post we explained how we can get image from notes using OData endpoints, in this post we are going to explain how we can create html web resource and use our java script method to get and display image. We need to implement two steps:

  •   Create html page
  •   Deploy html page and SDK.REST.js using web resource

Create html page

Create html page using any html editor, use following code for html page

<html lang=”en-us”><head>
<script src=”../ClientGlobalContext.js.aspx”></script>
<script type=”text/javascript” src=”SDK.REST.js”></script>
<script type=”text/javascript”>
//check if document is loaded or not
var imgControl = document.createElement(“IMG”);
//Check if documented loaded fully
document.onreadystatechange = function () {
if (document.readyState == “complete”) {
getnotesImages();
}
}
//this function is used to get image from notes
function getnotesImages()
{ //get regarding object id
var regardingObjectId=window.parent.Xrm.Page.data.entity.getId();
//assign notes entity name
var entitySchemaName=”Annotation”;
var odataQuery = “?$top=1&$select=AnnotationId,DocumentBody,MimeType&” +
“$filter=ObjectId/Id eq guid'” + regardingObjectId +
“‘ and IsDocument eq true and startswith(MimeType,’image/’) “;
//call retrieveMultipleRecords method in SDK.REST javascript script library
SDK.REST.retrieveMultipleRecords(entitySchemaName, odataQuery, getnotesImagesCallback, function (error) { alert(error.message); }, function(){});
}
//process callbanck result
function getnotesImagesCallback(resultSet)
{
if (resultSet.length > 0) {
var mimeType = resultSet[0].MimeType;
var body = resultSet[0].DocumentBody;
imgControl.src=”data:” + mimeType + “;base64,” + body;
document.getElementById(‘imagediv’).appendChild(imgControl);
}
}
</script>
<meta charset=”utf-8″></head><body style=”zoom: 1;”>
<div style=”width: 100px;” id=”imagediv”></div>
</body></html>

Deploy html page and SDK.REST library using web resource

Using following steps to deploy html page and SDK.REST library in MS CRM.

  •       Navigate to Settings -> Customization-> Customize the System from top navigation bar
  •       Navigate to Components -> Web Resources-> New
  •       Fill details like following screen

saveimg

  • Click on browse button and select your html web resource.
  •        Click on Save and then Publish
  •        Navigate to Components -> Web Resources-> New
  •        Fill details like following screen

sdk.rest

  • Click on browse and select SDK.REST.js from MS CRM SDK

Note: Please refer previous post for SDK.REST.js location.

Now we can place our html web resource in the account entity form by navigating Insert  -> Web Resource options. Save your changes and then publish account entity form.

form

When you will try to open your account record you should be able to see attached images loaded into html web resource.

img

HIMBAP | Need any help in Microsoft CRM 2015 Contact US !!

2 Comments

Filed under MS CRM 2011, MS CRM 2013, MS CRM 2013 Web Resource, MS CRM 2015

Creating RSS Feed Dashboard in Microsoft Dynamics CRM 2013: Part 1

Keeping you up-to-date with technologies specially with your respective technology is a very extensive requirement  of our day-to-day life. We need to know what is happening, what is released, and if we are not able to get the information directly we need Someone/Something who/which can help us to get latest updates. Here someone could be the person who is keeping him up-to-date and doing blogging to help others to keep them up-to-date :), and something could be the technology that we can use to get updates from blogs, news, forums etc.. so what is that ?? the answer is RSS. RSS helps  to easily stay informed by retrieving the latest content from the sites.

In this post we are going to explain how we can create RSS feed dashboard in Microsoft Dynamics CRM 2013 using free widgets available. Let’s consider we want to get RSS feeds from

  • Microsoft Dynamics CRM Team Blog
  • HIMBAPInfo Twitter Feeds
  • Dynamics News
  • Microsoft Dynamics Forum

We are going to use free widget from http://feed.mikle.com/ for demo purpose. Following are the high level steps to create our RSS feed dashboard

  1. Get RSS Feed URL for respective website
  2. Create widget
  3. Get sample code
  4. Create web resource in Microsoft Dynamics CRM 2013
  5. Place web resource in Microsoft Dynamics CRM 2013 dashboard

So let’s create our first web resource to get RSS feeds from Microsoft Dynamics CRM team blog, following are the steps to get widget code and place it in Microsoft Dynamics CRM 2013.

RSS Feed

  • Browse Microsoft Dynamics CRM 2013 Application
  • Navigate Settings | Customizations | Customize the System
  • Click New under Components | Web Resources
  • Use following properties
    • Name : MicrosoftDynamicsCRMTeamBlog.html
    • Display Name : MicrosoftDynamicsCRMTeamBlog.html
    • Type : Webpages(HTML)
  • Click on Text Editor and past the code that we copied from web site under Source Tab
  • Save and Publish your changes
  • Click on Preview we should be able to see Microsoft Dynamics CRM Team blog rss feeds like below

teamblog

Stay tuned for next post, in next post we will show how we can get Twitter RSS feeds and use it in Microsoft Dynamics CRM 2013.

HIMBAP | Need any help in MS CRM 2013 Contact US !!

2 Comments

Filed under MS CRM 2013 Web Resource, Show RSS Feed in MS CRM 2013