Friday, July 11, 2014

Integrate Twitter widget with MS CRM

You can see all the tweets of your twitter account in MS CRM. Below are the steps to be followed to integrate Twitter widget in MSCRM.

- Log on to your Twitter account.
- Click on Settings symbol (1) in twitter and select Settings.
- Select 'Widgets' in left panel.
- Click on 'Create new' button.
- Select 'User timeline' under 'Choose a timeline source' option.



A) Setting Widget properties in Twitter.

- Leave Username(2) as auto populated with your twitter user name, select 'Options'(3), 'Height'(4), 'Theme'(5) and 'Link color'(6) as your wish.
- Any changes you made in these properties are reflecting under Preview(8) in right side.
- Click on 'Create widget'
- Copy an HTML code(7) generated just below the Preview.
- Log on to MS CRM organization.
- Create one HTML webresource by adding the copied HTML code inside <body> tag.
- Create/Edit a dashboard to add newly created HTML webresource as a component in that dashboard.
- Save, Close and publish the dashborad.

- Go to that dashboard in CRM and you should be able to see all your tweets on CRM dashboard as in below image.


B) Twitter widget integrated with MS CRM dashboard

Thursday, June 19, 2014

Export a CSV without headers in SSRS

        In SSRS report we have an option to export report to many formats like Excel, CSV, PDF, Word and so on. In case of CSV export, we will get all the column headers in exported file. Some time we need CSV without column header. Below is the solution to get this done.

à Open rsreportserver.config file under C:\Program Files\Microsoft SQL Server\{INSTANCE}\Reporting Services\ReportServer in reporting server.
à Add below mentioned XML tags after <Extension Name="CSV"... />
<Extension Name="CSV (No Header)" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
<OverrideNames>
   <Name Language="en-us"> CSV No Header</Name>
</OverrideNames>
<Configuration>
   <DeviceInfo>
      <NoHeader>true</NoHeader>
   </DeviceInfo>
</Configuration>
</Extension>

à Save the file.

 After this changes, run one report. Under export option in that report, you must be able to see the option 'CSV No Header' as in below image(a). And exported data will not contains any headers.


CSV No Header
a) Export to CSV with no header

Tuesday, December 24, 2013

Commands

        Below are the useful commands used in Microsoft related products like .Net, CRM,...

Click on the item below to go through the description about that.

Assembly Registration:

The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently.

If you’re running Visual Studio on Windows 7: Choose Start, and then choose All Programs, Microsoft Visual Studio, Visual Studio Tools, Visual Studio Command Prompt.
                    
regasm <DLLFilePath> /codebase /tlb

Ex: regasm C:\Testing.dll /codebase /tlb
                    
                

ILMerge:

ILMerge is a utility that can be used to merge multiple .NET assemblies into a single assembly.

- Download ILMerge software from here and install in your machine.
- Goto Start, Run, cmd, OK.
- Goto C:\Program Files (x86)\Microsoft\ILMerge folder path and run below command.
                    
ilmerge /lib:<AssembliesFolderPath> <DLL1> <DLL2> <DLL3> <DLL4> /out:<OutputDLL>

Ex: ilmerge /lib:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies" C:\FirstDLL.dll C:\SecondDLL.dll C:\ThirdDLL.dll /out:C:\FinalDLL.dll
                    
                

Create Early Bound Classes:

CrmSvcUtil.exe is a command-line code generation tool for use with Microsoft Dynamics CRM 2011. This tool generates early-bound .NET Framework classes that represent the entity data model used by Microsoft Dynamics CRM. This tool is in the SDK download package in the SDK\Bin folder.

- Goto Start, Run, cmd, OK.
- Goto SDK\bin folder path and run below command.
                    
CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:<OutputFile> /url:<OrganizationURL> /domain:<Domain> /username:<UserName> /password:<Password> /namespace:<Namespace> /serviceContextName:<serviceContext>
Ex: CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:Xrm\Xrm.cs /url:http://MyCRM/MyOrg/XRMServices/2011/Organization.svc /domain:mscrm /username:administrator /password:mypassword123 /namespace:Xrm /serviceContextName:XrmServiceContext
For Online instance, you need to register your device as here.
                    
                    
CrmSvcUtil.exe /url:<OrgnizationURL> /out:<OutputFile> /username:<UserName> /password:<Password> /deviceid:<DeviceID> /devicepassword:<DevicePassword>
Ex: CrmSvcUtil.exe /url:https://myorg.crm.dynamics.com/XRMServices/2011/Organization.svc /out:GeneratedCode.cs /username:"myname@live.com" /password:"mypassword123" /deviceid:"9eqd9qip4meckbxhyi838gn3" /devicepassword:"543opae9itRWKO+U7fe+I3MRVANUyFFPcfDJYP5ItZo="
                    
                

Device Registration:

CRM SDK has provided a tool to register your device. Goto Command Prompt then to the folder path SDK\tools\deviceregistration\bin\Debug. Run below command. This will register you device and give Device Username and Device Password.
                    
deviceregistration.exe /operation:Register
                    
                

Monday, November 25, 2013

JQuery

        Below are the few useful statement, commands in JQuery.

Click on the item below to go through the description about that.

Disable the Control:

Disable the HTML controls like button, checkbox, textbox.
                    
$('#btn_submit').attr("disabled", true);
                    
                

Define the click event action:

Define the set of statements to be executed on click of control.
                    
$(document).ready(function () {
    $("#btn_submit").click(function () {
      // Click event action
    });
});
                    
                

Slide Taggle:

Slide taggle the content.
                    
$(".OnlineTable").slideToggle("slow");
                    
                

Get is checkbox checked:

Get the checkbox value. True, if checked. False, if unchecked.
                    
if($("#tdCheckBox").checked) {
    alert("Checked.");
}
else {
    alert("Unchecked.");
}
                    
                

Append the HTML tags:

Append the HTML tags inside another tag. In below example, <tr> tag is inserting into the <table> tag.
                    
$("#detail_table").append(
    "<tr>" +
    "<td class='thCheckbox' style='text-align:center;'>" +
    "<input type='checkbox' class='tdCheckBox' checked disabled /></<td>" +
    "<td><a class='anchor'>Full Name</a></td>" +
    "<td>E-Mail Id</td>" +
    "<td style='display:none;'>SSN</td>" +
    "</tr>"
);
                    
                

Tuesday, September 24, 2013

Retrieve query string parameter values in Javascript


Below is the Javascript code to fetch the query string parameter values.

function buttonClick() {

    var _QS = getQueryString();

    if (_QS['data'] == 'service') {
        // Service logic here
    }
    else if (_QS['data'] == 'sales') {
        // Sales logic here
    }
}

function getQueryString() {

    var _queryString = {};
    var _query = window.location.search.substring(1);
    
    // Split the parameters
    var _vars = _query.split("&");

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

        // Split the Name & Value pair
        var _pair = _vars[i].split("=");

        if (typeof _queryString[_pair[0]] === "undefined") {
            _queryString[_pair[0]] = _pair[1];

        } else if (typeof _queryString[_pair[0]] === "string") {
            var _array = [_queryString[_pair[0]], _pair[1]];
            _queryString[_pair[0]] = _array;

        } else {
            _queryString[_pair[0]].push(_pair[1]);
        }
    }

    return _queryString;
}