mscrmbynic.files.wordpress.com€¦  · web viewwhat are the different ways to create custom...

18
Explain some new features in MS CRM 2011. There are many new features in MS CRM 2011 like Enhanced UI, OOB Dashboard support, Auditing support, Field level security, Connections, Solution, Webresource, Role based Forms, refer: http://msdn.microsoft.com/en-us/library/gg309589.aspx for more details. What are the different web services available in MS CRM 2011? MS CRM 2011 have two web services I Organization Service, IDiscoveryService Which service can be used to access metadata information? We can use I Organization Service to fetch metadata. What are the different ways to consume MS CRM web service from client side? We can write Rest or Soap request to consume MS CRM 2011 webservices Rest Vs Soap. Difference between Dialog and Workflow. What is Solution? Difference between Managed and unmanaged solution. Is it possible to register plug-in through solution? What is field level security? How can we use auditing in MS CRM 2011? What is the use of document location entity in MS CRM 2011? How can we create a custom Ribbon button? How can we rename a custom Ribbon button? How can we open a custom webpage from ribbon button?

Upload: phamkhanh

Post on 21-Jul-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

Explain some new features in MS CRM 2011.

There are many new features in MS CRM 2011 like Enhanced UI, OOB Dashboard support, Auditing support, Field level security, Connections, Solution, Webresource, Role based Forms, refer: http://msdn.microsoft.com/en-us/library/gg309589.aspx for more details. 

What are the different web services available in MS CRM 2011?

   MS CRM 2011 have two web services I Organization Service, IDiscoveryService

Which service can be used to access metadata information?

We can use I Organization Service to fetch metadata.

What are the different ways to consume MS CRM web service from client side?

We can write Rest or Soap request to consume MS CRM 2011 webservices

Rest Vs Soap.

Difference between Dialog and Workflow.

What is Solution?

Difference between Managed and unmanaged solution.

Is it possible to register plug-in through solution?

What is field level security?

How can we use auditing in MS CRM 2011?

What is the use of document location entity in MS CRM 2011?

 How can we create a custom Ribbon button?

How can we rename a custom Ribbon button?

How can we open a custom webpage from ribbon button?

How can we use Filtered views in MS CRM 2011.

What is Web resource and what the different types of web resource.

How can deploy a Silverlight web resource in MS CRM 2011.

What is the use of sub grids?

What are the basic steps involved in developing plug-in.

What is the use of tracing Service in plug-in development?

Page 2: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

What are the new messages introduced for plug-in in MS CRM 2011?

What is sandbox plug in?

What are the different ways to create custom report for MS CRM 2011.

Difference between Early bound and late bound.

...............................

Explain some new features in MS CRM 2011.

What are the different web services available in MS CRM 2011?

Which service can be used to access metadata information.

-        

What are the different ways to consume MS CRM webservice from client side?

-        

Rest Vs Soap.

-         Please refer: http://msdn.microsoft.com/en-us/library/gg490659.aspx

Difference between Dialog and Workflow.

-         Dialogs are synchronous process and Workflows are asynchronous process.

-         We can develop custom workflow, but can’t customize dialogs.

-         Refer : http://msdn.microsoft.com/en-us/library/gg309471.aspx

What is Solution?

-         Solution is a collection of MS CRM 2011 components that can be exported and imported easily from one CRM organization to another CRM organization.

Difference between Managed and unmanaged solution.

-         Managed solution can’t be customized, but can be uninstalled easily.

-         Unmanaged solution can be customized, you can’t uninstall unmanaged solution.

-         Refer : http://msdn.microsoft.com/en-us/library/gg334576.aspx for more details

Is it possible to register plugin through solution?

Page 3: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

-         Yes.

What is field level security?

-         Using field level security we can hide information based on user security role in MS CRM 2011. Refer : http://msdn.microsoft.com/en-us/library/gg309608.aspx

How can we use auditing in MS CRM 2011.

-         Auditing can be configured easily through CRM UI. Refer: http://www.avanadeblog.com/xrm/2010/09/crm-2011-feature-of-the-week-9132010-auditing.html for more details on auditing.

.......................

What is the use of document location entity in MS CRM 2011.o Document location entity is used to store location of crm record which point to a document folder in share point.• How can we create a custom Ribbon button.o To create a custom ribbon button we need to modify RibbonDiffXml of the entity where want to place our button. We can use different ribbon editor tool in codeplex or can manually modify it, you can refer my post to create custom ribbon button.• How can we rename a system Ribbon button.o We can do this by modifying ribbondiffxml, but we need to get current ribbon button id, that we can get from the sample ribbon generator application that comes with Microsoft CRM 2011 SDK.• How can we open a custom webpage from ribbon button.o We can use Action to open custom page refer: http://msdn.microsoft.com/en-us/library/gg328038• How can we use Filtered views in MS CRM 2011.o Filtered view is a way to enforce security as database level, while working with report we use Filtered view to fetch data based on user security role. Microsoft CRM 2011 contains filtered view for every entity.• What is Webresource and what the different types of webresource.o Web resource is new feature in Microsoft CRM 2011, which is used create reusability of the code and other component. We can create different type of web resource in Microsoft CRM 2011 for example javascript, Image, silverlight, CSS and HTML page.

Page 4: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

• How can deploy a Silverlight webresource in MS CRM 2011.o Please refer:  http://msdn.microsoft.com/en-us/library/gg328358.aspx• What is the use of sub grids?o Sub grids are used to display any entity view in another entity, you can add subgrids from Insert tab while customizing entity form and can select entity to display view in that subgrid• What are the basic steps involved in developing plugin.o Refer : http://msdn.microsoft.com/en-us/library/gg328490.aspx• What is the use of tracing Service in plug in development.o This is a new feature in Microsoft CRM 2011, using tracing service we can get more error details and can display them to user.• What are the new messages introduced for plugins in MS CRM 2011?o Microsoft CRM 2011 has introduced many new entities, you can refer new entity and their messages in “message-entity support for plug-ins” files that comes with Microsoft CRM 2011 SDK.• What is sandbox plugin.o Sandbox plugin is a plugin which runs under Isolation mode. All Microsoft CRM 2011 plugin writing for online is registered in sandbox mode.• What are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late bound.o Early bound – Easy to code, you don’t need to remember field’s name, compile type checking, required extra efforts to generate early bound classes.o Out bound- you should know fields name, run time checking, performance wise better than early bound. refer: http://msdn.microsoft.com/en-us/library/gg327971.aspx for more details

Step By Step Extending MS CRM 2011 Ribbon Part-1

In this part I am going to show how we can create a custom button on existing tab. Basically when adding custom button first you need to decide where you want to put this button, as we want to add new button in existing tab we have two option for this

1.       Add button on existing group in Existing Tab.

Page 5: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

2.       Add button on new group in Existing Tab.

In this post I am going do implement Option 1. let’s take example and let consider we want to add a button on existing tab in account entity. You can see in account’s tab we have group like save, collaborate, process anddata.

So if we want to add a new button in existing Account tab in any of these groups let’s say we want to add in “Process” group.

So adding button on existing tab or group we need to know id of the parent group, that you can get from sample application provided in MS CRM 2011 SDK under “\sdk\samplecode\cs\client\ribbon\exportribbonxml” location. Open this project and run it will ask your crm server name and organization detail and will generate entity ribbons.

We are trying to modify Account ribbon so we need to check id in accout ribbon open account ribbon in visual studio or any xml editor. Our goal is to add button on account form and in process group so check for “Mscrm.Form.account.MainTab.Workflow” and copy group id like below

Now we have group id with us let’s create a solution with account entity

Follow below steps to create solution

1. Goto setting->Solution->New

2. Enter General information and save.

3. Select Entities->Click on Add Existing and select Account.

Page 6: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

Your solution should look like below

4. Export solution as unmanaged.

5. Unzip your solution and open customizatio.xml in  visual studio or in other xml editor.

6. Search for <RibbonDiffXml> tag

7. We need to modify above xml to extend account ribbon. We need to add a node <CustomAction> under <CustomActions> node to add custom button.

There are basically 3 pionts here that we need concentrate

i. Mscrm.Form.account.MainTab.Workflow.Controls._children  –  we need to use location value as parent id+”_children” keyword to create custom button on existing group.

ii. Sequence – we need to set sequence of custom action and our button greater than existing values for that group

iii. Command- we need to define command that we want to use for our custom button.

8. We need to define a command definition for our button like below, we need to make sure that we are using the same id that we used in button node.

Page 7: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

<CommandDefinitions>

<CommandDefinition Id=”MyTest.Account.Form.CommandDefinition”>

<EnableRules>

<EnableRule Id=”Mscrm.Enabled” />

</EnableRules>

<DisplayRules/>

<Actions>

<Url Address =”www.google.com”></Url>

</Actions></CommandDefinition>

1. save and zip your solution again and import.

2. Publish all customization.

3. Open account entity form you will get a button like below.

Step By Step integrating Bing Maps in MS CRM 2011 1 Votes

In this post I am going to show, how easily we can integration bingmap in MS CRM 2011. I am going to create a html webresource which will show account’s city location on bing maps based on city address.

Page 8: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

Here are the steps to implement the same

1. First steps is to get Bingmap developers key.

2. Create an html page and use below code in this page and save that page. (you can put this page in intpub location and can test this in your browser, in that case you need to hardcode city value).

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html>

   <head>

      <title></title>

      <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>

 

      <script type=”text/javascript” src=”http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0″></script>

 

      <script type=”text/javascript”>

 

          var map = null;

 

          function GetMap() {

              // Initialize the map

             map = new Microsoft.Maps.Map(document.getElementById(“mapDiv”), { credentials: “Your BingMap Key”, mapTypeId: Microsoft.Maps.MapTypeId.road });

Page 9: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

 

          }

 

          function ClickGeocode(credentials) {

              map.getCredentials(MakeGeocodeRequest);

          }

 

          function MakeGeocodeRequest(credentials) {

            //Get City value from MS CRM account’s form

              var geocodeRequest = “http://dev.virtualearth.net/REST/v1/Locations/” + window.parent.Xrm.Page.getAttribute(‘address1_city’).getValue() + “?output=json&jsonp=GeocodeCallback&key=” + credentials; //make sure to replace field name if you are using custom field.

              CallRestService(geocodeRequest);

          }

 

          function GeocodeCallback(result) {

                   if (result &&

                   result.resourceSets &&

                   result.resourceSets.length > 0 &&

                   result.resourceSets[0].resources &&

Page 10: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

                   result.resourceSets[0].resources.length > 0) {

                  // Set the map view using the returned bounding box

                  var bbox = result.resourceSets[0].resources[0].bbox;

                  var viewBoundaries = Microsoft.Maps.LocationRect.fromLocations(new Microsoft.Maps.Location(bbox[0], bbox[1]), new Microsoft.Maps.Location(bbox[2], bbox[3]));

                  map.setView({ bounds: viewBoundaries });

 

                  var location = new Microsoft.Maps.Location(result.resourceSets[0].resources[0].point.coordinates[0], result.resourceSets[0].resources[0].point.coordinates[1]);

                  var pushpin = new Microsoft.Maps.Pushpin(location);

                  map.entities.push(pushpin);

              }

          }

 

          function CallRestService(request) {

             var script = document.createElement(“script”);

              script.setAttribute(“type”, “text/javascript”);

              script.setAttribute(“src”, request);

              document.body.appendChild(script);

          }

Page 11: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

 

      </script>

   </head>

   <body onload=”GetMap();ClickGeocode();”>

      <div id=’mapDiv’ style=”position:relative; width:400px; height:400px;”></div>

   </body>

</html>

 

3.  Create a HTML webresource and upload your html page here.

4. Open account form and Create a new Tab let’s say Accountlocation.

5. Add a new webresource and browse your webresource from web resource lookup.

Page 12: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

 

6. Save and publish your form.

7. Open any account record and check for Account location tab.

Some CRM 2011 JavaScript2 Votes

Page 13: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

//Hide Section in

Xrm.Page.ui.tabs.get(“Name of the tab”).sections.get(“Name of the section”).setVisible(true);

Xrm.Page.ui.tabs.get(“Name of the tab”).sections.get(“Name of the section”).setVisible(False);

//Force Submit method has changed to

Xrm.Page.getAttribute(“Field Name”).setSubmitMode(“always”);

//Get Selected Picklist value

var _Value = Xrm.Page.getAttribute(“Name of Picklist”).getSelectedOption().text;

//Get Entity Attributes based on ID

var context;

var serverUrl;

var ODataPath;

function Getinfo() {

    context = Xrm.Page.context;

    serverUrl = context.getServerUrl();

    ODataPath = serverUrl + “/XRMServices/2011/OrganizationData.svc”;

}

function GetID() {

    var ID = Xrm.Page.getAttribute(“Nameof ID field”).getValue()[0].id;

    RetrieveAccountRecord(ID);

Page 14: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

}

function RetrieveAccountRecord(Id) {

    var RetrieveAccountReq = new XMLHttpRequest();

    RetrieveAccountReq.open(“GET”, ODataPath + “/AccountSet(guid’” + Id + “‘)”, true); //I am fetch account data

    RetrieveAccountReq.setRequestHeader(“Accept”, “application/json”);

    RetrieveAccountReq.setRequestHeader(“Content-Type”, “application/json; charset=utf-8″);

    RetrieveAccountReq.onreadystatechange = function() {

    RetrieveAccountReqCallBack(this);

    };

    RetrieveAccountReq.send();

}

function RetrieveAccountReqCallBack(RetrieveAccountReq) {

    if (RetrieveAccountReq.readyState == 4 /* complete */) {

        if (RetrieveAccountReq.status == 200) {

            var RetrievedAccount = this.parent.JSON.parse(RetrieveAccountReq.responseText).d;

            if(RetrievedAccount.Telephone1!=null)

                Xrm.Page.getAttribute(“TargetTelephonefield”).setValue(RetrievedAccount.Telephone1);

            if(RetrievedAccount.Emailaddress1!=null)

Page 15: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

                Xrm.Page.getAttribute(“TargetEmailfield”).setValue(RetrievedAccount.Emailaddress1);

                      }

        else {

            errorHandler(RetrievedAccount);

            alert(“Error in Fetch Account data”);

        }    }}

Calling External Webservice from MS CRM 2011 Asynchronously – Javascript

If you are looking for the code to call external webservice from MS CRM 2011, you can create a webresource in MS CRM 2011 and call use below code

function CallCustomWebService(FunctionName, ParameterNameList, ParameterValueList,ProxyURL)

{//FunctionName-Nameof the function to call

//ParameterNameList-Array of Parameter names in your proxy function

//ParameterValueList-Array of Parameter value

//ProxyURL-URL of your proxy

var CallingFunctionURL = “http://tempuri.org/” +FunctionName;

var xml = “<?xml version=’1.0′ encoding=’utf-8′?>” +

“<soap:Envelope xmlns:soap=’http://schemas.xmlsoap.org/soap/envelope/’”+

” xmlns:xsi=’http://www.w3.org/2001/XMLSchema-instance’” +

Page 16: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

” xmlns:xsd=’http://www.w3.org/2001/XMLSchema’>”+

“<soap:Body>” +

“<” + FunctionName + ” xmlns=\’http://tempuri.org/\’>”;

for (i = 0; i< ParameterNameList.length; i++) {

xml = xml + “<” +ParameterNameList[i] + “>” + ParameterValueList[i] + “</” +ParameterNameList[i] + “>”;

}

xml = xml + “</” +FunctionName + “>”;

xml = xml +“</soap:Body></soap:Envelope>”;

xmlHttp = new ActiveXObject(“Msxml2.XMLHTTP”);

xmlHttp.open(“POST”,ProxyURL, true);

xmlHttp.setRequestHeader(“Content-Type”,“text/xml; charset=utf-8″);

xmlHttp.setRequestHeader(“Content-Length”,xml.length);

xmlHttp.setRequestHeader(“SOAPAction”,CallingFunctionURL);

xmlHttp.onreadystatechange =function() {

ParseResult(xmlhttp);

};

xmlHttp.send(xml);

}

function ParseResult(XmlRequest)

Page 17: mscrmbynic.files.wordpress.com€¦  · Web viewWhat are the different ways to create custom report for MS CRM 2011.o Fetchxml and SSRS.• Difference between Early bound and late

{

if(XmlRequest.readyState == 4) {

if(XmlRequest.status == 200) {alert(XmlRequest.responseXML.text);//Fetch your result from response xml here

}

else {

alert(“Request Failed ”);

}

}

}