[VSTO] Debugging VSTO applications

One very useful trick to debug VSTO applications is this “cheeky” flag: VSTO_SUPPRESSDISPLAYALERTS. It’s a environment variable to enable error messages about dodgy exceptions, like COM exceptions. For example, I was getting a strange behavior in my Office Word application when I was trying to add a new Plain Text Control:

PlainTextControl

However, my VSTO application didn’t show me any messages or warning about any error, until I added this environment variable VSTO_SUPPRESSDISPLAYALERTS to my system with value 0. Next, I got this message:

ComException

It means that you can’t set a Plain Text Control title bigger than 64 characters.

Don’t forget this friendly helper :)

enviado 02 marzo 10 08:32 por rtebar | 1 comentarios   
Archivado en:
[WPF] Custom Check Box Template

Once again, let’s enjoy the WPF’s flexibility to change any style and template. In this case, I’ve customised the Check Box’s style to get the next appearance:

 Unchecked

 UnChecked

 Checked

 Checked

 Focus

 focus

Mouse Over

mouseOver

 

You can download  the code from here. 

My example is based on this good MSDN article about Check Box’s template. There you can also find templates for other controls.

enviado 26 febrero 10 09:01 por rtebar | 1 comentarios   
Archivado en:
[WCF] Delegation between WCF and CRM Services

Impersonation and Delegation are important concepts around the services' world. Impersonation restricts client access to resources in the local machine where is running the service and Delegation restricts client access to resources on other machine. In my scenario, I was trying to access from a WCF service to Dynamics CRM 4.0 services using Delegation.

In WCF, Delegation is a special type of Impersonation, which can be configured easily according to the next good articles:

However, some points are not really emphasized and you shouldn’t forget them:

  • Allow impersonation in the corresponding server. This configuration must be set from the domain controller.
  • User who is running WCF service must have enough privileges to impersonate the expected users
  • Allow Delegation from the client side. You have two options to do it:
    • Client Config. file:
 <behaviors>
<endpointBehaviors>
<behavior name="NewBehavior">
<clientCredentials>
<windows allowedImpersonationLevel="Delegation" />
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
    • Programmatically:
proxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Delegation;
  • Set the userPrincipalName properly in client configuration file according to the user who is running the WCF service:
 <client>
<endpoint address="service address with an allowed protocol to impersonate"
behaviorConfiguration="NewBehavior" binding="Allowed protocol to impersonate"
bindingConfiguration="defaultEndPoint" contract="MyAssembly.MyContract"
name="defaultEndPoint">
<identity>
<userPrincipalName value="serviceuser@mydomain.com" />
</identity>
</endpoint>
</client>
enviado 23 febrero 10 08:37 por rtebar | 1 comentarios   
Archivado en:
CRM Case Study. Alfapeople and TTT Moneycorp

Below you can watch the video of a Microsoft case study about one of the main customer of my current company Alfapeople Ltd: TTT Moneycorp. Here I’ve enjoyed working in interesting and challenging projects related to CRM, WCF and WPF

 

In addition, in the next link http://www.microsoftmovies.co.uk/dynamics/general/ you can watch more case studies about different businesses and Microsoft solutions in UK.

Enjoy :)

enviado 20 enero 10 10:38 por rtebar | 0 comentarios   
Archivado en:
[CRM4] Thanks Rollup 8. Error adding a user to CRM 4

According to the CRM Update Rollup 8, they have resolved the following error:

  • “After you install Update Rollup 3 or Update Rollup 4, you cannot add a user to more than one organization in the same deployment of Microsoft Dynamics CRM if the user exists in a child domain"

…and definitely they have, because I tested it the last week. However, the scenario wasn’t exactly a parent/child domain, but a trusted link domain were instead.

Download CRM 4 Rollup 8

enviado 15 enero 10 07:47 por rtebar | 1 comentarios   
Archivado en:
[CRM4] Searches and Views

Searches are fundamental in any CRM. Dynamics CRM provides different ways to search records from any entity. The most powerful search is the Advanced Find image, which allows normal users to create custom queries and save them as new views, so that they can reuse them:

image

Why do some attributes not show up?  Only searchable attributes are showed up in Advanced Find

NewAttributeSearchable 

Looking at CRM Metadata a bit deeply, this “Searchable” property is translated to “ValidForAdvancedFind” property in AttributeMetadata.

However, Advanced Find isn’t the most common option, since users normally need to search records quicker, without set any query. In this case, Dynamics CRM offers Quick Find views.

Where are the Quick Find views and when do we use them in Dynamics CRM? When we use the “Search for records” options from any entity, actually we are calling to the Quick Find Active view, which replaces the current view (in our example, Active Printer view would be replaced by Quick Find Active Printers view)

SearchActiveView

Which attributes  are used by “Search for records”? Those were configured in the  Quick Find View for the corresponding entity ( 'Printer' in this example)

AddFindColumnsToQuickFind

enviado 14 enero 10 06:12 por rtebar | 1 comentarios   
Archivado en:
[CRM4] Add/Remove Activities and Notes relationships

When you create a new entity in CRM 4, you have to define if it will have Note and Activities relationships. After you’ve created it, you won’t be able to change it (important to remember it!).

activitiesAndNotes

However, sometimes we forget it :) and we need to add or remove these relationships later. In that case, we can do the next trick:

  1. Export the corresponding entity that you want to add / remove Note and Activities relationships
  2. Delete this entity from CRM
  3. In the XML file that you’ve exported with the customisations, change the value of the attributes HasRelatedActivities and HasRelatedNotes
  4. Import again the updated customisations to CRM
enviado 12 enero 10 05:59 por rtebar | 1 comentarios   
Archivado en:
[WPF/WCF] DataGrid + DoubleClick + MVVM + Loading Splash (description & code)

Using the DataGrid WPF Toolkit, this post shows a simple client/server application to fill a DataGrid according to the information that is provided by a WCF service. When any row receives a double click, a new document (jpeg or docx for this example) is opened by an external application.

WPFDataGridExampleLoading

WPFDataGridOpenDocument

The application is designed using MVVM pattern, where View and ViewModel are placed in the client side and Model in the server side. In our example, we will show a set of “Alerts” in a DataGrid , so that we will have the next elements:

  • Model: Alert. This class provide all the information about an “Alert” entity.
  • View: Custom DataGrid with all the alerts
  • ViewModel: Intermediary element between Model and View to decouple the alert model from its view. In our case,  ViewModel provides a collection of alerts and a command to open its associated document.

About the DataGrid control, I would like to highlight the next points:

  • Double click behavior in DataGrid control using attached properties. See the new HandleDoubleClick and TheCommandToRun properties in DataGrid, which are declared in WpfApplication.TestGridView => AttachedProperties => SelectorDoubleClickCommandBehavior.cs
  • Using DataGridTemplateColumn: I got some problems trying to apply padding in the cell content, regarding the rest styles and behaviors (see Themes folder). To resolve it, I’ve used a DataGridTemplateColumn, which allows integrate any custom content in a cell. In this way, I’m using a TextBlock with a specify margin to simulate that padding.

In the server side (WCF service), I’ve implemented a request/response messages architecture, so that it would be easier and scalable to add other functionality like delete or create alerts (see the service implementation in WcfService.ServiceLibrary => AlertsService.cs, as well as the retrieve messages and handler).

Download source (VS2008)

This application is based on different sources, which can be found below. At the same time, I would like to be grateful to my workmate Wael, who is a great developer and he always gives me great advices.

Useful Links:

enviado 07 enero 10 06:02 por rtebar | 1 comentarios   
Archivado en: ,
[DataBase] Quick way to test DB connection: UDL files

Many times we need to test quickly database connections. An easy and handy way is to use UDL files. From your desktop, try to create a new file and rename its extension with “.udl”

image

if you do double click in the new file, you will get a familiar dialog to configure your DB connection string and test it:

image

enviado 16 diciembre 09 07:44 por rtebar | 1 comentarios   
Archivado en: ,
[WPF] Custom Listbox (description and source code)

WPF allows to create custom controls with flexibility. In this case, I’ll show you a custom Listbox with the follow interesting features:

  • Resizeable (listbox and its items)
  • Custom items with text and picture
    • Mouse over effect with custom color
    • Selected item with custom background color
  • Items Source from Binding. In my example, I’ve used a collection of “Customer” objects to fill the elements of the listbox, simulating that they are provided by a external service, as well as each picture is a array of bytes inside of “Customer” type.
  • Custom converters in binding fields:
    • To fill each picture (array of bytes) in a Image object

<Image  Margin="2" Stretch="Uniform"  Source="{Binding Path=Image,Converter={StaticResource LocalByteArrayToImageConverter}}"/>

    • To format the address in line. Address is another custom type “Address” inside of “Customer”. Using another converter, we can take the desired fields that we want to show and how we want to do it

<TextBlock Text="{Binding Path=FullAddress, Converter={StaticResource LocalAddressToFullAddressConverter}}"  Style="{StaticResource TextBlockContentStyle}" />

image

DOWNLOAD CODE HERE

enviado 02 noviembre 09 06:00 por rtebar | 1 comentarios   
Archivado en:
[ASP.NET] A single assembly for the entire Web site

From Visual Studio 2008, we don’t have yet, by default, an option to compile a web site with all its assemblies in only one DLL. But you can do it installing Visual Studio 2008 Web Deployment Projects. Read more about it here.

enviado 31 octubre 09 12:52 por rtebar | 0 comentarios   
Archivado en:
[CRM 4] Recovering from ISV.config errors

CRM accepts different types of easy and quick user interface customizations like new menus, custom buttons, and navigation areas, which can be added
throughout the application.

To do it, only we should update the ISV.config, an XML file that we can export like any other customisation of CRM. However, although CRM validate this XML file, some error can be entered and our CRM interface can be damaged.

Supposing, like a good practise, we did a copy security of our original ISV.config, we will be able to import it again using this URL:

http://[server name]/[OrganisationName]/tools/systemcustomization/importcustomizations/importcustomizations.aspx

Directly, you will access to the Import Customization tool:

image

enviado 29 octubre 09 08:08 por rtebar | 1 comentarios   
Archivado en:
[CRM] CRM or XRM ??

What is CRM?

Microsoft Dynamics CRM is a versatile business solution that we can easily tailor to your specific

business needs. As an inherent part of your business strategy Microsoft CRM exceeds the benefits of a sheer software solution and gives you an all-inclusive, 360 degree overview of your business.

The flexible platform of Microsoft CRM allows you to automate manual processes, increase efficiency and productivity and truly connect with your customers. Managing sales, marketing and customer service becomes infinitely easier and your return on investment will be visible quickly.

Because Microsoft CRM works from the familiar interface of Office Outlook, user-adoption and training are brought to a minimum.

What is xRM?

CRM manages customer relationships by offering a holistic view of customer information and the ability to track interactions with clients. However, businesses deal with a myriad of relationships that evolve around different entities besides customers.

The C for customer can therefore be replaced by X, creating: xRM. The X in this acronym stands for Anything. XRM is about managing relationships, transactions and processes involved with ANY entity. Not just customers. The objects or entities that needs to be managed can be patients, buildings, potential candidates for hire, grant applications or legislation; Anything that requires the mapping and tracking of business information, relationships, activities and processes.

Every business has specific needs, but developing a solution from scratch is risky and costly. XRM gives you the platform you can use to build future applications.

enviado 26 octubre 09 08:40 por rtebar | 2 comentarios   
Archivado en:
[CRM] BoomerangSMS

Let me introduce you one of our last Alfapeople CRM project: BoomerangSMS. This solution allows you to automatically send and receive text messages through CRM by using the Boomerang SMS API. The project consists of an SMS Router Service plus all the customisations required to get it working on any Microsoft Dynamics CRM Deployment.

Boost your productivity and plummet costs by routinely managing appointment scheduling, order confirmations and delivery times according to preset workflows. This add-on opens up a wealth of flexibility for your customers and helps you to respond to their preferences by communicating via their favored channel.

The best point of all is that BoomerangSMS is an open source project with License GNU General Public License version 2 (GPLv2). You can download it and find more information from http://boomerangsms.codeplex.com/

You can see a demo in these videos:

Boomerang for Dynamics CRM Setup

(http://www.screencast.com/t/dWhsmznad4)

 

Boomerang Service Appointment Demo

(http://www.screencast.com/t/E3uPMd4ad)

 
enviado 10 octubre 09 04:15 por rtebar | 0 comentarios   
Archivado en:
[CRM 4] Error using Bulk Deletion Jobs: "This condition had one or more Lookup values that are not valid"

Using the Bulk Deletion Jobs tool that I told you in my previous post, I’ve found a bug, which is not yet resolved and I’m trying to find out it. I’m not sure if it’s a CRM issue or it’s a issue of my solution, so I’m looking for your opinion and similar experiences.

The point is when you create programmatically Build Deletion Jobs whose query contains conditions with LookUp types, (DateTime, Picklist, strings, decimals,.. work fine) these attributes aren’t showed properly in the Bulk Delete Operation form properties. Instead of that, they are showed like warning signal:

image

if you click over the warning signal, you get the message “This condition had one or more Lookup values that are not valid.”:

image 

However, this Bulk Job Deletion jobs was created according to the next System View, so “Enter Value” should be “parent a1”

image

One important note: although Lookup attributes are now showed properly, the Bulk Deletion Operations work fine and they remove the corresponding records, but It could be dodgy and scaring, since you won't be sure which records have been deleted really.

Any suggestion?

Thank you very much.

enviado 07 octubre 09 05:10 por rtebar | 0 comentarios   
Archivado en:
Más envíos Página siguiente >

Search

Go

Sindicación