Disculpa, pero esta entrada está disponible sólo en English.
TopLine Strategies is an AEP Company
Copyright © 2005-2009 TopLine Strategies. All rights reserved.
Disculpa, pero esta entrada está disponible sólo en English.
Disculpa, pero esta entrada está disponible sólo en English.
Disculpa, pero esta entrada está disponible sólo en English.
The ability to import and export CRM 2011 solutions is an extremely handy way to migrate additions and modifications between environments, so it’s sometimes easy to forget that not all changes are carried over with a solution. It seems natural that if an admin were to delete a field in environment A, that the exported solution would also delete that field in environment B upon import. However, this is not the case, as is plainly stated in the MSDN article, Introduction to Solutions:
Solutions can only add new solution components or overwrite existing solution components. Solutions cannot be used to delete solution components.
This isn’t normally an issue, since the admin can manually delete the field in environment B, provided that the solution was exported as Unmanaged. What if they exported it as a Managed solution, though? While this gives the admin the option to uninstall the solution from environment B, removing all the customizations it contained, it’s not possible to manually delete one of the imported fields. Uninstalling the solution and reinstalling a version without the field is an option, but this may result in data loss.
Currently, the best solution appears to be the one outlined in the (very appropriately named) MSDN blog article, Deleting things from a deployed CRM 2011 managed solution package. To summarize, the admin can create a second Managed solution in environment A with the same publisher and different name, that contains everything the original Managed solution does, sans the deleted element. Once they have installed this second solution to environment B, the admin can go ahead and safely delete the original solution. The system will see that both solutions have the same publisher and will not delete the elements held by the second solution.
The article goes into more depth, providing a thorough walkthrough and even example files so you can try it out yourself. It may not be an ideal approach, especially for vendors that are releasing their Managed solutions as products, but it appears to be the best option available for now.
If you can accomplish all of your tasks with one SSIS package, I’m happy for you – but sometimes more than one is necessary. If you ever find yourself with multiple packages with similar properties (variables, connection managers, executables, etc.) it may be in your best interest to use a Package Configuration. This will save you some time down the road if you decide to create another package, or update properties of the existing ones. What a package configuration will allow you to do is make properties of the package external – saved as either an XML configuration file, environment variable, registry entry, or a few others. Once external, you can setup all or some of your packages to use the configuration – this way if changes need to be made, you can do so without having to update each and every package. In this post I will be creating a XML package configuration that contains my connection managers. Recently I did some SSIS cleanup for a client; they had 25+ packages, all containing the same connections. I recreated their database schema locally for testing purposes and enabled a package configuration in each package. By doing so, I was able to update the connection strings in my configuration file to use my local databases and make changes to the packages as needed. Upon completion I could simply change the connection strings back and deliver back to the client. At the same time, if the client ever moved their data to a different location, they could follow the same steps without having to edit any of their packages. The two connections I have are ‘Duck’ and ‘Goose’:

To create a configuration, select Package Configurations from the SSIS dropdown on your menu bar:

Check the box to enable package configurations, and click Add.
For configuration type, select ‘XML Configuration File’. Make sure the radio button for ‘Specify configuration settings directly’ is selected and click Browse. Navigate to a common directory (I used C:\PackageConfigurations) and name your file ‘Connections.dtsConfig’, click Save.
When you click Next you will be brought to a screen where you can select what exactly will be included in your configuration. As I stated before we are just going to add our connection managers. Check the box for each of your connections (or expand to select only specific properties), and click Next.
Name your configuration, and click Finish. You’ve successfully created a configuration – your package is currently using it. So now let’s say you have another package that contains Duck and Goose connections, how do we set it up to use our new package configuration? Open the package and again click SSIS > Package Configurations. Make sure the ‘Enable Package Configurations’ checkbox is checked, and click Add. Browse to your configuration file, and click Next. When you select an existing configuration you will be prompted to either reuse or overwrite the file, click ‘Reuse Existing’. Click Finish, and then Close. Your package is now using the same configuration file – you can open the XML file in any editor and change the connection strings and it will be updated across all packages that use the configuration. Keep in mind this can be used for variables and executables as well, making the configurations even more flexible!
A simple method to calculate age in years in both JavaScript and C# that avoids rounding up. Additional info on the number of days in a year can be found here. JavaScript
function CalculateAge( birthDate )
{
var msPerDay = 1000 * 60 * 60 * 24;
var daysPerYear = 365.242199;
var age = ( new Date() - new Date(birthDate) ) / msPerDay / daysPerYear;
return age;
}
C#
public static double CalculateAge(DateTime birthDate)
{
double daysPerYear = 365.242199;
TimeSpan span = DateTime.Now.Subtract(birthDate);
double age = span.TotalDays / daysPerYear;
return age;
}
As someone whose background has been in development of business applications (specifically around Microsoft technology), when I started working with QlikView a ways back, it was a transition. Sure, you’re still building something using technology for end users, but it requires a different way of thinking. Here are some tips to keep in mind when starting with QlikView if you come from a traditional software development background.
Hopefully these will help someone as they get started with QlikView. Just like any other software, learning QlikView takes time. It can be especially daunting if you’re not used to working with BI tools but are used to software development.
Disculpa, pero esta entrada está disponible sólo en English.
When I first started playing around with CRM 2011 plug-ins, I pretty much dove in headfirst to see what I could do. Sure, I browsed the SDK and modeled my code after the examples, but I ended up running into a nasty issue with one of my embellishments. What I thought was an innocuous method of handling the IOrganizationService proved to be problematic, considering how CRM 2011 plug-ins function.
I was creating the service like you usually do:
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>(); IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
Then I made a horrible mistake:
CrmData.Service = service;
At the time, I thought: “It sure is nice and clean, keeping all my data access methods in a separate class! Why don’t I just plop the service into some variable so I don’t have to pass it for each method call?” Little did I know that my choice to not RTFM would’ve told me exactly why I shouldn’t do that.
From MSDN’s Write a Plug-In article:
For improved performance, Microsoft Dynamics CRM caches plug-in instances. The plug-in’s Execute method should be written to be stateless because the constructor is not called for every invocation of the plug-in. Also, multiple system threads could execute the plug-in at the same time. All per invocation state information is stored in the context, so you should not use global variables in plug-ins or attempt to store any data in member variables for use during the next plug-in invocation.
The worst part about this is that it works great, up until you have the plug-in firing more than once, simultaneously. Various errors will be logged, from messages about the service already being in use to errors exclaiming that basic interal CRM functionality, such as RetrieveMultiple, cannot be found.
So, for anyone else out there who has a CRM 2011 plug-in that’s failing in strange and inconsistent ways, you may want to see if you’re keeping your IOrganizationService on a short leash. Sending it away to another class to be used indiscriminately by any ol’ plug-in execution is a surefire way to pad the server error logs!