Team Foundation Service

Maintaining a Version Control System is an additional overhead for a software development team and its further difficult when the team members are connecting from different regions of the world from different networks. Some development teams use different tools with different programming languages and maintaining different types of source controls will be a challenge. Most of the time project managers track development progress from some other system and team members should log in to that system at the end of the day and log whatever the things they have done.

Microsoft provides Team Foundation Service for Source Controlling facilities as well as project management capabilities with Scrum templates.
TFS Preview

http://tfspreview.com/

Team Foundation Service can be accessible from anywhere with IDEs like visual studio and eclipse. Development teams can be start working on their solution without thinking of managing infrastructure setup and maintainance in the their premises. It mainly provides following areas of services;

Continue reading “Team Foundation Service”

Disable Required Fileds When Hide Tabs in CRM 2011

There are requirements to hide tabs according to the selections in the form and if any tab contains required fields it will display them automatically and asking user to fill those fields when saving the form.

Following Javascript function will disalbe all the controls in the tab and then it will not ask user to fill those required fields.

// tabName : Name of the Tab, isDisable: booloean value for Enable/Disable controls
DisableAllControlsInTab: function (tabName, isDisable) {
    var tabControl = Xrm.Page.ui.tabs.get(tabName);
    if (tabControl != null) {
        Xrm.Page.ui.controls.forEach(
        function (control, index) {
            if (control.getParent().getParent() == tabControl && control.getControlType() != "subgrid") {
                control.setDisabled(isDisable);
            }
        });
    }
}

Following Javascript function can be used to show or hide the tab and it will disable/enable its controls accordingly.
Continue reading “Disable Required Fileds When Hide Tabs in CRM 2011”

Intellisense for Xrm.Page in CRM 2011

In CRM 2011 javascripts for crm forms can be stored externally as web resources and those are no longer embedded in CRM forms. Javascripts in web resources can be edited using an external editor. Visual Studio IDE provides intellisense to the Javascripts in Xrm.Page with the help of XrmPage-vsdoc.js. It works with Visual Studio 2010 and Visual Studio 2012. Thanks to Patrick Verbeeten for bringing this cool feature in.

In order to get the intellisense Visual Studio IDE needs the reference of the XrmPage-vsdoc.js file. Follow the following steps to enable intellisense for Xrm.Page in the Javascript.

[1] Download XrmPage-vsdoc.js from HERE

[2] Add XrmPage-vsdoc.js in to the Visual Studio IDE

Continue reading “Intellisense for Xrm.Page in CRM 2011”

Debugging a Plug-in

Plugin is a .NET assembly that can be used to intercept events generated from the CRM system to perform a variety of actions. Some common plug-ins will perform a complicated update routine on CRM entities and\or attributes when it might be impractical to use Javascript or Workflow.

Not like in most of the other developments, in Plugins developers have to debug the CRM plugin code at the time of running the application. Developers writing the plugin code inside the plugin and some times the logic can be write in a seperate assembly and from the plugin code it can be invoked. When writing the whole logic inside the plugin is little complex to test the plugin logic by debugging the plugin as it executes from the application itself in a given event such as create an entity, update or delete.

There are two ways of debugging a CRM plugin as follows,
[1] Attaching the debugger to the w3p.exe process
[2] Forcing the add-in to call the debugger

Demonstration
A plugin has written targeting Account entities as follows and a step has registered to be fired on Account entity’s Create step.
Continue reading “Debugging a Plug-in”

CRM 2011 Autonumbering Solution

Auto numbering features are important in any business application to accomplish some business needs. Same in the CRM application and it needs additional customizations and plugin(or a custom workflow) to be implemented for the entity to statisfy auto numbering requirements. Jaimie Ji has a solution for this in CodePlex and this post is to demonstrate how to get use of Auto Numbering Solution in CRM. Advantage of the solution is that; developers dont need to write seperate plugins for each entity which needs auto numbering and it provides prefix, postfix, starting number and increment by features as well. Also it always open to change the configurations and no need any hard code values.

Unmanaged Solution (http://crm2011autonumber.codeplex.com/)

Auto Numbering Solution has a CRM solution and the solution contains one entity called “Counter” to save all the settings for all the counters. If there are two auto numbers in two different entities, just need only two records of this counter entity in the CRM application.

CRM.Plugin.SequenceGenerator is another component of the solution. If the solution doesnt contain the plugin, developers can get the source code from CodePlex, build it and can get the assembly registered in the CRM application manually.

There are some images as utilities to the Counter entity in the solution.

Source Code (http://crm2011autonumber.codeplex.com/SourceControl/list/changesets)

Source code contains the visual studio solution for the plugin. Developers can download the code, buil it and use the assembly for the registration. Plugin registration tool can be used to register the pluging in CRM application. The assembly can be attached to the CRM auto numbering solution and can be exported as a managed solution to be used in some other CRM projects.

Continue reading “CRM 2011 Autonumbering Solution”

Coding Duel for Fun with Pex

Pex for fun is a simplified version of Pex. Nothing to do with any installation for playing with this and just log in to www.pexforfun.com and play. Code editor supports C#,Visual Basic and F#, also intellisense capabilities are avalable in the editor itself.

Games are puzzles which has their own secret(hidden) implementations. Players can implement the code according to the clues given by Pex. Players can ask from Pex anytime that how close to the hidden or the expected implementation. There are random puzzles that players can picked up and allows new puzzles to be entered to the puzzles list.

These puzzle games are very interactive coding duelsa and it will improve the problem solving capabilities and recalling capabilities as well.

Pex for fun is now avalable in Windows Mobile.

 Pex In Windows Mobile
Lets see how to play and solve a puzzle.I got following puzzle and the Puzzle method getting one integer parameter and returns it. The puzzle has hiden its implementation.

Continue reading “Coding Duel for Fun with Pex”

Pex – Step in to Automated Exploratory Testing for .NET

Pex automatically generates test suites with high code coverage. Right from the Visual Studio code editor, Pex finds interesting input-output values of  methods, which can be saved as a small test suite with high code coverage. Microsoft Pex is a Visual Studio add-in for testing .NET Framework applications.Pex is coming under Microsoft Power Tools and its a result of one of Microsoft research projects. Here’s the link for Pex http://research.microsoft.com/en-us/projects/pex/

Following example will give a brief introduction on Pex and will be useful to get an idea on how it works.

Simple WPF application has ben created and it accepts two parameters(expecting two integers) from its silverlight page and displays addition of those two integers. There is a seperate Class called “Calculation” in the same namespace and it has “CalculateResult” method which adding two integers and return the result back. The program is working properly with two integers but as developers we cannot expect that the end user will always enters two integers and in this program it has not handled. In any parameterized method in a program, there can be unhandled scenarios like this(actually not  simple like this more complicated than this 🙂 )

 
 Following method will get two parameters and will try to return sum of those two.
Calculate Result Method
Lets run Pex against the CalculateResults method.
 Running Pex
Continue reading “Pex – Step in to Automated Exploratory Testing for .NET”

Debug a CRM Plug-in using the Plug-in Profiler

Debugging CRM Plugins is no longer difficult with Plug-in Profiler. Follow the steps below and try to debug a CRM plugin in your environment.

1.Build the Plug-in Registration tool according to the instructions in its Readme file. The tool can be found in the Tools\PluginRegistration folder of the SDK download.

Current version of the SDK is 5.0.10

2.Run the Plug-in Registration tool.
Run the Visual Studio solution of plugin registration tool or after build the solution, Run the “PluginRegistration.exe” under “\tools\pluginregistration\bin\Debug\” folder

3.Connect to a Microsoft Dynamics CRM server and organization. For more information on connecting to a server and organization, refer to the SDK topic: Walkthrough: Register a Plug-in Using the Plug-in Registration Tool.

4.Register a plug-in and step on the Microsoft Dynamics CRM server. Keep a copy of the debug compiled plug-in assembly on the computer where you are running the tool.
Although Released or Debug assembly has been registered with the PluginRegistration tool, here it needs Debug Compiled vesion of the assembly to be debug using plugin profiler.

5.In the tool’s main window, select Install Profiler. You will now see a Plug-in Profiler node in the list.


Continue reading “Debug a CRM Plug-in using the Plug-in Profiler”

CRM Manipulation Library

Very useful set of String manipulations, Date manipulations, Calculations, RegEx and Web functions which are not coming as CRM2011 OOB features are included in the manipulation Libray. In another words it is a set of custom workflow activities which can be used with crm workflows and dialogs as well.

Installation Manipulation Library comes as a CRM solution and as a solution of Visual Studio. There are two ways of installing it and use in CRM.

CRM Solution import

CRM solution can be imported to the CRM and after publishing it, the features will be available to use in processes. Thats the easiest way of installing it and if some one needs an unmanaged solution, they can export it as an unmanaged  solution and simply use it in any CRM environment.

Solution Import

Continue reading “CRM Manipulation Library”

Field Validations – ASP.NET

Date Text Field Validations

Requirement:Validate entering birth day in a text field with mm/dd/yyyy format.

code in the .aspx or in .ascx


<asp:TextBoxID=”dateOfBirthTextBox”runat=”server”></asp:TextBox>

<asp:RequiredFieldValidatorID=”dateOfBirthRequiredFieldValidator”runat=”server”

ControlToValidate=”dateOfBirthTextBox” ErrorMessage=”Required”></asp:RequiredFieldValidator>

<asp:RangeValidatorID=”dateOfBirthRangeValidator”runat=”server” ControlToValidate=”dateOfBirthTextBox”

ErrorMessage=”Please enter a past date in mm/dd/yyyy format”  Type=”Date”Display=”Dynamic”></asp:RangeValidator>

code in the .cs file – Under OnInit or PageLoad methods

this.dateOfBirthRangeValidator.MinimumValue = DateTime.MinValue.ToString(“MM/dd/yyyy”);
this.dateOfBirthRangeValidator.MaximumValue = DateTime.Today.ToString(“MM/dd/yyyy”);