XAML Intellisense broken …

I do not know the complete cause for the broken intellisense in my Silverlight XAML editor. It could be installation of the windows SDK or the Latest MSDN but to fix it is relatively simple ..

Locate the TextMgrP COM library and re-register it. I located it at

C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll

Simply

Regsvr32 “C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll”

and intellisense should be back and operational

– Mark

Silverlight Cont …

I have been working more and more with Silverlight and really like what I see. There have been a few issues thus far that I have been able to get around;

1. When ever I make a change to my web service that the Silverlight application is calling I have to delete the service reference and recreate it or I get some strange errors on execution. I tried rebuilding the references but the errors would still occur. So Delete! Not a big issue now but I can see it rearing its ugly head when it came tome to deploy.

2. I created a user control that had 2 event handlers on it. In the consuming page when I subscribed to both events I would get a strange XML parse error. If I removed either handler attribute it would compile correctly. Since my control was a hack to see how things work I reworked the handler functionality to be more consistent and was able to work through this issue as well.

Highlights

I am a windows developer at heart and though I develop for the web as well, I just like the flow of developing for the desktop. Silverlight seems to have bridged that gap for me and I am really impressed with this initial release.

I am also finding typing out the XAML by hand because of the Readonly designer a good thing as I am learning the underlying syntax and how the flow of things work.

– Mark

SLX 7.2.2 is now Gold

SalesLogix 7.2 SP2 went gold on Friday. This is the best release to date and brings the quality level up. The release is currently available to Beta partners but expect it to be available to your BP’s very shortly.

– Mark

My First Silverlight Success

So I got a little deeper into Silverlight this morning as I was initially discouraged with my initial introduction with Silverlight. Things seemed somewhat more difficult then I thought they would be and I was assuming that it was me more then the toolset.

My Goals

My goal was to create a simple search function that would work against a SalesLogix database through the provider. To make this happen I would need the Silverlight control, and a web service to provide the search data.

Starting off with the UI and moving backward I created the basic XAML to display a filter text box, button and a results grid.

All looked pretty good with the display and the resulting XAML is;

<Grid x:Name="LayoutRoot" ShowGridLines="False" Background="LightSteelBlue" Margin="2"> <StackPanel>    <StackPanel Orientation="Horizontal" Margin="2">

<TextBox Width=”400″ x:Name=”searchValue”></TextBox>

<Button x:Name=”Button1″ Click=”Button1_Click” Content=”Search” Width=”95″ Height=”30″ />

</StackPanel>

<my:DataGrid AutoGenerateColumns=”True” x:Name=”myGrid” Width=”500″ Height=”180″></my:DataGrid> </StackPanel> </Grid>

Now that my layout was good. I ran the application to make sure that it displayed in the browser. All is good.

Web Service

Creating the Web service was not too bad. Standard ASP.net web service that was stubbed out as usual with the HelloWorld default method.

I created a basic Account class to be a property bag to return up to my Client as follows;

/// <summary>

/// Summary description for Account

/// </summary>

public class Account

{    public string Name { get; set; }

    public string Phone { get; set; }

public Account()

    {

    }

}

The next thing I did was a new web method to get the accounts based on a value provided by the Client. Deciding to return a list of Accounts as I wanted to avoid any XML parsing on the client and it seemed the most natural way to access the data. The final code is

[WebMethod]

public List<Account> GetAccounts(string lookupValue)

{    SlxConnection conn = new SlxConnection("Dev64", "SalesLogix_Eval", "Admin", "Admin");

    List<Account> accounts = new List<Account>();

using (OleDbConnection connection = new OleDbConnection(conn.ToString()))

    {

        connection.Open();

        string query = string.Format("select Account, IsNull(MainPhone,'') from Account where Account Like '{0}' order by Account", lookupValue);

        OleDbDataAdapter adapter = new OleDbDataAdapter(query, connection);

        DataTable table = new DataTable();

        adapter.Fill(table);

if (table.Rows.Count > 0)

        {

            foreach (DataRow row in table.Rows)

            {

Account account = new Account() { Name = (string)row[0], Phone = (string)row[1] };

                accounts.Add(account);

            }

        }

    }

return accounts;

}

Note that the SlxConnection class is nothing more then a specialized connection builder ensuring a proper provider based connection. You can use the actual connection string in the constructor of the OleDbConnection as well.

Adding the Service Reference

To access the web service I needed to add a service reference in the Silverlight project. I selected to add a ‘Solution based’ reference and when completed all of the proxy objects were created.

This step was the most confusing for me initially as I tried different ways to add a reference and most for me did not work. I finally was able to add the reference and use the Soap method to get the results I was expecting. Not that this is a problem with the implementation but with my current understanding on how everything works.

Wiring up the Search Button

Finally I was ready to wire up the search button. Every service call now seems to be ASYNC by default which is a good thing. So basically I new’d up instance of the AccountLookupSoapClient proxy that was created for me when I added a Service Reference.

ServiceReference1.AccountLookupSoapClient client = new ServiceReference1.AccountLookupSoapClient();

Next was to wire up the Async handler. Pretty simple type

client.GetAccountCompleted +=

And the ‘Add Event Handler’ auto complete starts, after hitting Tab, Tab and empty stub was available for me to add the code.

Then the code for actually making the WS call was added

client.GetAccountAsync(searchValue.Text);

Result Handler

When the Async call comes back the handler is called and on the UI thread so to populate the data in the grid all that was required was a check for an error and to set the grids ItemSource to the result.

The final code for the Silverlight page is;

private void Button1_Click(object sender, RoutedEventArgs e)

{    ServiceReference1.AccountLookupSoapClient client = new ServiceReference1.AccountLookupSoapClient();

    client.GetAccountsCompleted +=

        new EventHandler<TestingSilverlight.ServiceReference1.GetAccountsCompletedEventArgs>(client_GetAccountsCompleted);

    client.GetAccountsAsync(searchValue.Text);

}

void client_GetAccountsCompleted(object sender, TestingSilverlight.ServiceReference1.GetAccountsCompletedEventArgs e)

{

    if (e.Error == null)

    {

        Account[] accounts = e.Result;

        myGrid.ItemsSource = accounts;

    }

}

Run the application and Presto …

– Mark

Silverlight 2.0 SDK does not fully Un-install

I was having some strange IE blowups that seemed to occur after I Installed Silverlight 2.0. I decided to uninstall Silverlight and see if the issue was occurring because of it. After fiddling around a bit I discovered that the issue was occurring because of Flash.

So being still very excited to get into Silverlight I proceeded to re-install the SDK. I was promptly welcomed to ‘You cannot install because ..” message. Well I was able to install earlier and the only thing that changed was I had installed Silverlight before. Well I decided to to a no-no and go into the registry and folder structure and remove any reference to Silverlight, there were many. Long story short, after deleting all registry keys and a couple of folders I was able to install Silverlight again.

Be wary, uninstall does not actually uninstall.

– Mark

Reading helps …

In my earlier post I spoke of that problem that Silverlight 2.0 beta had with not allowing interactive support in the designer. I just finished reading a Blog by Scott Guthrie where he mentions this explicitly. So, the feature is not there yet, and I should not have griped about it :<

I also started to see strange crashes in my IE browser. Seem to happen around the same time as installing Silverlight, however found out that it was actually caused from Flash. As soon as I upgraded Flash to the latest version, crashes disappeared.

– Mark

Silverlight 2 First Impressions

I eagerly downloaded Beta1 of Silverlight yesterday anticipating the cool stuff I was going to enable. With the controls and web service functionality I believed that within a short time I would get something up and running.

So Downloading and installing was easy .. Not much of a problem here. I started up Visual Studio 2008 and created my first Silverlight Application. I reviewed the toolbox and saw all of the new controls available for me to write my application. I selected a button from the toolbox and tried to drag it onto the Canvas … Nothing, I double clicked the button, and again nothing.

It seemed for me, I would have to type in my XAML by hand. So I marched forward and started to code the UI. The fact that I cannot layout controls in the Designer is a big pain for me.

Another issue that I have is that the property browser just does nothing. I do not know if there is something I am missing in the install however all I can see is a label in the middle of the properties pane saying ‘Property editing not available.

I have been able to get some simple examples working but I honestly am not a big fan of having to type out reams of XAML to get something working.

My next steps will be to install Blend and see if that experience bodes a better design time experience.

– Mark

What is CRM

Were having a bit of a snow day here in Ontario and while I was gazing out the window in my office I started to think about the State of CRM, and more specifically what is CRM.

You see my day job focuses on building on top of CRM. Adding new features, integrating into from Disparate sources and hooking in new ways to get to the data such as Mobile.

Because so much of what I see is in extending the CRM package I have formulated what a CRM system really is, and that is a Base Application Framework. It a nut shell it is a tool to build upon processes and functionality that is distinct from company to company.

Now there is much to be said for the OTB processes that are provided by the vendors, as they either provide the glue or a jump start to a more relevant feature set that works for company ABC. So where does this lead me to you ask …

Given that IMHO CRM is an application framework and the goo on top plays second fiddle, it seems that there are more opportunities for introducing the “CRM’ into Organizations. If some of the features are pealed back into optional libraries and the CORE is provided businesses application development can be quickly jump started where the cost of the licenses of the CRM are justified by the reduction of labour and the consolidation of the QA to a single organization.

Now to really deliver on this a ‘CRM’ application framework needs to deliver;

Online/Off-line Support

Any CRM system should allow access to functionality if connected or not connected to the central repository.

Simplified GUI development

We have come a long way in the development of rich UIs. CRM applications should embrace this allowing the WSWYG development of forms, controls and other UI elements.

Modern Language Support

Support development using either .net languages or Java. My personal preference would be .net.

Windows and Web

Capability to target either windows or web clients and handle the rich functionality each provides.  There should be some centralized configuration that can be shared between the platform, but in the end each platform should have extensions that can allow for a more powerful end user experience.

WPF anyone, Silverlight, AJAX …

Mobility

True mobile integration should be provided through all layers including customization, deployment, data synchronization. Generally mobility is a second class citizen strapped on to the system. OTB support would ensure a tight coupling and the reuse of infrastructure.

Full Security (record, field, UI Elements)

Security should not be missed. Record and Field level security is a must. Extend that with a custom security provider where a organization can determine the role, user makeup and the row level rules and life is good. UI should also have security capabilities where fields are locked down. The capability to also detemine the functionality of fields that should not be shown to the end user. An example would be either hiding the field or displaying a nice watermark on a field that cleanly states ‘N/A’ instead.

Rules Engine

Capability to centrally define rules on entities is key to having the distributed environment. However I do believe that the rules can be also moved up the some of the richer client levels. Specifically where you have off-line windows clients or mobile clients it is good to pre-validate the data entered and inform the user at time of entry.

Workflow

Workflow and a workflow engine will allow not only the developers on the system but also the business users to define processes to help the day to day usage scenarios of the system. Any workflow designer needs to meet the needs of the target audience and should not provide too much noise around getting the job done.

Team Development support

We are now at a point in our development history where there is a rich choice of Source code systems available. Integration into these systems providing the base project items as files moves everything out of the CRM database and into the shared SCC repository. What this does is finally separate the business data from the customizations. I have developed solutions that store plug-ins and customizations in the database before but would think anything I do in the future will be file store and SCC based.

External Development

Finally, the CRM system is a framework but will never be a development environment. VS and Eclipse provide rich developer tools and have a greater focus on developer productivity. Add to that the rich ecosystem of add-ins and it just makes sense to piggy back of one of these environments. Though the CRM application should provide all of the base customization services these external tools will provide greater possibilities of extension.

  1. Expose a public Extensibility API
  2. Provide standard methods if introducing code into the application
  3. Provide deployed output in several modes (release and debug)
  4. Provide replaceable base classes for any code generation
  5. Provide replaceable control classes for any code generation

Now package the base framework, development and Deployment services and a new customer base can be established. Not based on the Premise of delivering CRM but on getting the business needs up and running faster on-top of a dependable framework.

Disclaimer – I work on SalesLogix CRM by Sage and the platform does provide a lot of what I have discussed. What would be great if there was a way to ‘Library’ function sets and not include them in a distribution.

– Mark

Silverlight goes to Nokia

The more I hear about Silverlight the more I am in to it. It seems that Nokia and Microsoft have made an agreement for support on the S60 and S40 phones and Internet Tablets. I may just have t get back into mobile development. I am wondering what kind of support for Silverlight will be on the IPhone .. hum…

See more details here

I can only assume the public Beta for Silverlight 2.0 will be announced at Mix08.

– Mark