Showing posts with label SSIS. Show all posts
Showing posts with label SSIS. Show all posts

Wednesday, 8 May 2019

IntelliSense in SQL Server 2008 R2 Management Studio stops working (most of the time)

After installing Visual Studio 2010 Service Pack 1, the IntelliSense in SQL Server 2008 R2 Management Studio stops working (most of the time).

The fix is to install SQL Server 2008 R2 Service Pack 1.

The fix for this issue was first released in Cumulative Update 7. For more information on Cumulative Update 7  click here.

Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. I recommend installing SQL Server 2008 R2 Service Pack 1 or Service Pack 3.

I hope this was informative. Please feel free to leave comments, if any.

Microsoft Dynamics CRM - Global Option Sets (Picklists)

CRM 2011 was released with many new features. New features were added in the core application, configuration and extending CRM. One of the most appreciated new feature is Global option sets. The other name given to it is Global picklists.

In Dynamics CRM 4.0 there were local option sets. Let's say the requirement is to have a country option set in 10 different entity forms. In order to have the country list, we need the country option set in all the entities and so we need 10 country option sets. All these 10 country option sets had same items in it. If we change the name of a country or add a new country, then we need to make a change at all 10 places. Dynamics CRM 2011 has improved upon this limitation. We can have one global option set for a country. Then each country list in every entity can derive from this "country Global option set". In case any changes are there, it will be done at one place and all derived lists are updated.

I will show how to create and use a global option set. I will create a global option set for the country. I will add few countries and then create a local option set in the entity "Movie". The local option set on the "Movie" form will be derived from this global option set. For the clarity of this demo, I have marked important sections on the screen shots by a green rectangle.

1) I will go to my unmanaged solution "Movies". I am soon planning to write a blog on Unmanaged Solutions.

Click on the component "Option Sets" from the left navigation. This will open the list of all my option sets in this solution. All the option sets added here will be Global option sets. These global option sets are part of the solution "Movies" which later can be deployed from one environment to another as part of a managed solution. Click on New button.

Click New button to Add a new Global Option Set
Click New button to Add a new Global Option Set

2) The new Global option set window opens. "Display name" is the label of this Global option set. "Name" is the unique Schema name and Logical name for this Global option set. Add the countries as options (also called as items in CRM lingo). Each country I add will have a Label and a Value. I suggest to accept the default "Value" assigned by CRM.

New Global Option Set Window
New Global Option Set Window

3) I entered few countries to this Global option set. The Global option set window will look like below. Save and close.

Create a new Global Option Set for Countries
Create a new Global Option Set for Countries

4) I will create a local option set for the entity "Movie". Click on New to create a new field for entity "Movie".

This new option set field for Movie is derived from the Country Global option set. This Movie option set will display all the countries defined in the step above.

New Country field for
New Country field for "Movie" Entity

5) Add the required fields. Pay special attention to the "Type". The Type of this field is "Option Set".
I will select "Yes" to the option of use existing option set.

Select the Country value against the option set. This is where our local field will reference to any Global option set we select.

Leave default value as unassigned. Save and close.

Add this new field on the entity form. I then click on "Publish all Customizations" for my solution. This will publish all the above changes and make the new field available on the form.

Configure the new field as Country Global Option Set
Configure the new field as Country Global Option Set

6) Go to any existing record for the entity. I have opened the Movie record "GoldenEye" and find the Country option list. I can select any country from the list. Any changes to the Global option set will be automatically reflected here and at all the places which refers to it.

Use the new field on the
Use the new field on the "Movie" Entity Form

I hope this blog about CRM 2011 feature of Global Option Sets (Picklists) was informative. Please feel free to leave comments, if any.

Unit Testing for CRM 2011; Plugins, Custom Workflow Activities and Custom .Net Code

Every time we write a plugin and a custom workflow activity, we should make sure it works as desired. The business logic we write within these plugins and custom workflow activities, should accept the business confirmed parameters and should perform the agreed operations.

The above holds true each time we change these plugins and custom workflow activities. Every time we make a change, the plugins and custom workflow activities again need to be tested and verified. Unit testing in Visual Studio 2010 (out of the box) helps us achieve this process. In unit testing we will always need to Mock the CRM contexts and the data.

“Moq” mocking library can help in writing unit tests for CRM 2011 plugins and custom workflow activities, by mocking the CRM context and makes it easier to pass parameters and define the results.

Moq (pronounced “Mock-you” or just “Mock”) is the only mocking library for .NET developed from scratch to take full advantage of .NET 3.5 (i.e. Linq expression trees) and C# 3.0 features (i.e. lambda expressions) that make it the most productive, type-safe and refactoring-friendly mocking library available. And it supports mocking interfaces as well as classes. Its API is extremely simple and straightforward, and doesn’t require any prior knowledge or experience with mocking concepts.

The below screen shot shows the skeleton of how the MOQ can help us in Mocking (the CRM 2011 context). After Mocking, we can unit test by changing input parameters as we do with any other .Net unit testing.

MOQ: Mocking the CRM 2011 Context for Unit Testing in Visual Studio 2010
MOQ: Mocking the CRM 2011 Context for Unit Testing in Visual Studio 2010

I hope this was informative. Please feel free to leave comments, if any.

Sunday, 10 December 2017

Adding and Updating Security Roles to a Migrated Business Process Flow

There is still an issue in case you want to "Enable Security Roles" for a migrated Business Process Flow in Dynamics 365 Version 9.

When you do a migration from a lower version of Dynamics CRM to Dynamics 365 and as part of the migration are existing custom business processes. If you open one of these business processes and select "Enable Security Roles", there are no options to either "Enable for everyone" or "Enable only for the selected security roles". 

"Enable Security Roles" Option for Migrated Business Process

In Dynamics 365 for new Business Process Flows and existing system Business Process Flows, there are no issues. You can find options "Enable for everyone" and "Enable only for the selected security roles". 

"Enable Security Roles" Option for Existing Business Process

The solution is to directly open "enable security roles" windows for a migrated business processes using a URL.

The format of the URL for a Business Process in my Dynamics 365 V9.0 environment would be:

https://ashishm1974.crm.dynamics.com/tools/dialogs/RoleAssignment.aspx?dType=1&oid=%7b6E9A821B-3CBC-4F04-9619-F2B723FE4880%7d

This will directly open the window to enable security roles for a business process. Replace the URL and Business Process GUID as in your Dynamics 365 environment.


Friday, 1 December 2017

Use of Option Set Vs Two Options in a Business Process Flow

Business processes within Dynamics 365 streamlines and creates a visualization of information flow through various stages. Each stage combine "data steps" to reach a business decision to either move forward or backward.

The data steps in a business process stage are fields used to capture information. Option sets and two options can be used as data steps. 

Two option should only be used if a data step is not required in a business process stage. The problem with two options is that they cannot have "unassigned value" as a default. Therefore even if a two option is marked as required on a business process stage, one can still move to next stage based on the default selected.

1) I have created 2 fields on Opportunity. These will be used as data steps to capture whether due diligence is done. 
One field is an option set with two values "Yes" and "No". The default value is unassigned.

Option Set Field

Second field is a two options with values "Yes" and "No". Default value is "No". The issue here is that the default value can only be selected as "Yes" or "No".

Two Options Field

2) Both these fields are displayed as data steps on the Opportunity Business Process "Qualify" stage.

Business Process on Opportunity


3) Open a new Opportunity, enter a "Topic" and "Save". This will create a new opportunity in "Qualify" stage. As seen the two fields are displayed as data steps in "Qualify". The top field is an option set and bottom field is a two option.

Testing these Fields


4) The both are required but only option set field will force a user to select a value (if nothing is selected) when moving to next stage. 

Option set can have an unassigned value as a default. Therefore always use option set over two options whenever it is required to capture data on a business process stage