More About This Website

All information is provided "AS IS" with no warranties, and confers no rights

Login
Powered by Squarespace
Wednesday
Nov182009

Mixing Silverlight 4 with Dynamics CRM

Today we are happy to be able to announce the availability of some Silverlight 4 book content. For existing Silverlight developers looking to get up to speed quickly with the features we are releasing the Silverlight 4 Overview. This is a little over 50 pages of content covering the new Silverlight 4 features.  For the rest of this week using code SL4DaveBlog at checkout you can get the new Silverlight 4 content for only $5 almost half off the normal price.

For developers that are new to Silverlight but are comfortable with .NET we are releasing a preview of Silverlight 4 Jumpstart. Silverlight 4 Jumpstart content builds on the success of the Silverlight 3 Jumpstart book to offer content focused at the business .NET developer.

Both of these offerings are available today and will continue to evolve with the Silverlight 4 release. These are delivered in an electronic format (PDF) and will continue to be updated with more current releases of Silverlight 4.

Stay tuned for a video demo of the following demo including being able to drag files and drop them on the CRM web client using the Silverlight 4 Drop Target support.

The following is an excerpt from the Silverlight 4 Overview chapter that is available as part of Silverlight 4 Jumpstart Preview book or as a standalone chapter from SilverlightJumpstart.com. The full overview chapter covers all the major new features of Silverlight 4 to help you get up to speed quickly.

Microsoft has fast tracked Silverlight to be a strong competitor in the global RIA space and squarely positioned itself against competitors like Adobe, Google and Yahoo for production of the finest RIA toolset. The initial battleground was video, but we are now seeing Silverlight has strong potential for building business applications as well. We have tried through the previous chapters to streamline your learning of the current version of Silverlight by focusing on the key areas a business developer needs to know. Now it’s time to talk about the future and what the road ahead looks like for Silverlight.

It had only been about nine months since Silverlight 2 was released in October 2008 that Silverlight 3 hit the street in July 2009. Then, just four months after the release of Silverlight 3 Microsoft released Silverlight 4 Beta at its Professional Developer Conference in November 2009. Each of these releases build on the prior one to add new features while at the same time keeping compatibility to support this fast pace of innovation.

If I had to pick a single theme for the main items that are part of Silverlight 4 I would have to choose “You Asked, Microsoft built it”. I say that because many of the items like Printing or Web Camera/Microphone support for example were some of the highest user prioritized features. You can check that out for yourself at Silverlight.UserVoice.com and while you’re there add or vote on a couple of your requests.

Silverlight 4 is also a major deal because it’s the first release of Silverlight to support .NET 4 CLR (Common Language Runtime). This gives developers access to the latest runtime features that are added to CLR4 including things like dynamic object support.

In addition to the core Silverlight 4 Beta, Microsoft also released corresponding updates to the other tools and products used with Silverlight. The tools for working with Silverlight from within Visual Studio were updated to support the Silverlight 4 Beta. This includes increased designer support to make it easier to develop Silverlight applications without having to leave Visual Studio for a separate tool. A new version of the Silverlight Toolkit was also released that goes along with the Silverlight 4 update. An update was also released for .NET RIA Services which has now been renamed as WCF RIA Services to reflect the fact that it now rides on top of WCF. This is an evolution of the prior .NET RIA Services releases and positions it to leverage WCF as a foundation to build on going forward. In addition to the WCF change a number of additional features such as improved inheritance support were added to WCF RIA Services in this release. Finally, a preview release of Blend for .NET 4 was released to allow it to work with Silverlight 4.
In the rest of this chapter we are going to preview some of these features that you will see in the Silverlight 4 Beta release.

Web Camera / Microphone Support

Silverlight 4 now allows developers to access to the raw audio and video streams on the local machine from applications running both in and out of the browser. Using these capabilities developers can write applications including capture and collaboration using audio and video. This is built-in to the core runtime and no other special downloads are required on each machine. When the audio or video is accessed for the first time by the application the user will be prompted to approve the request. This ensures that audio and video is never accessed without the user’s knowledge preventing applications that capture silently in the background. The following is an example of the prompt the user sees when the application requests access to the devices.

VideoAudoPrompt

You will notice in the above image the site name is displayed. This is another safeguard to ensure the user knows which site is requesting access to the devices. Access is granted to just this application and only for this session of the application. Currently there is no option to persist the user’s approval to avoid re-prompting each time the application is run. Additionally, it’s all or nothing; you don’t get to choose video or microphone. It’s a combined approval.

Users with multiple devices can select the devices they want to be the default devices using the properties on the Silverlight plug-in. This can be selected by right-clicking on a Silverlight application and going to the Webcam/Mic tab.

The following is an example of what you will see on that tab.choosedefaultmic

Developers can get access to the chosen devices using the CaptureDeviceConfiguration class. Using this class you can call the GetDefaultAudioCaptureDevice or GetDefaultVideoCaptureDevice methods to retrieve the users selected defaults. The class also has GetAvailableAudioCaptureDevices and GetAvailableVideoCaptureDevices methods that allow you to enumerate the available devices if you want more control of choosing a device besides the default.

Prior to using the devices you must request access to the device by calling the RequestDeviceAccess() method from the CaptureDeviceConfiguration class. When this method is called it is responsible for showing the user approval dialog we saw earlier. This method must be called from a user initiated event handler like the event handler for a button click event. If you call it at other times it will either not do anything or produce an error. Using the AllowedDeviceAccess property you can query if access has already been granted to the device.

The quickest way to get started using the video is to attach the capture from the device to a VideoBrush and then use the brush to paint the background of a border. The following XAML sets up the button to trigger the capture and a border that we will paint with a video brush.

<StackPanel>

<Button x:Name="btnStartvideo" Click="btnStartvideo_Click"

Content="Start Video"></Button>

<Border x:Name="borderVideo" Height="200" Width="200"></Border>

</StackPanel>

Next, the following private method TurnOnVideo method is called from the handler for the click event on the button. This satisfies the requirement to be user initiated.

private void TurnOnVideo()

{

VideoCaptureDevice videoCap =

CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();

AudioCaptureDevice audioCap =

CaptureDeviceConfiguration.GetDefaultAudioCaptureDevice();

CaptureSource capsource = new CaptureSource();

capsource.AudioCaptureDevice = audioCap;

capsource.VideoCaptureDevice = videoCap;

if (CaptureDeviceConfiguration.AllowedDeviceAccess

|| CaptureDeviceConfiguration.RequestDeviceAccess())

{

capsource.Start();

VideoBrush vidBrush = new VideoBrush();

vidBrush.SetSource(capsource);

borderVideo.Background = vidBrush;

}

}

As you can see in the code above, default audio and video devices are retrieved and assigned to a CaptureSource. Access to the devices is then checked and requested if not already approved.

If access is granted the Start() method on the CaptureSource is invoked to begin capturing audio and video. Finally, the VideoBrush source is set to the CaptureSource instance and the background on the border is set to the VideoBrush.

Overtime we will probably see some very interesting applications of the audio and video support. One example that we put together was using it with Microsoft Dynamics CRM. In this example application a membership application was simulated that associated members with pictures and stored the pictures in a database. Think of a place similar to Costco, Sam’s Club or your local gym that snaps your photo for their records.

In the following image you can see how a tab has been added to the Contact form using the CRM customization capabilities.

 

CRMCap1

A Silverlight 4 application is then hosted inside that tab that will provide the user experience for capturing the images. When the Start Camera button is clicked the user will be prompted to approve the access and the video feed will begin as you can see below.

crmcap3

The video feed will keep showing the live image updated from the web cam until stopped. The Capture button on the above application allows the user to capture one of the image frames from the capture source. The AsyncCaptureImage(..) method on the CaptureSource class allows you to request that a frame be captured and your callback invoked. The callback is then invoked and passed a WriteableBitmap representing the captured frame.

crmcap4

This image can then be saved back to the Dynamics CRM server and associated with the record being viewed.

In the above example we looked at how you could use the video capabilities to capture a static image. More advanced applications are also possible for things like collaboration by showing the real time audio and video feed of multiple users.

You have been reading about one of the many new and exciting features of Silverlight 4 that are covered in the complete overview chapter. Visit SilverlightJumpstart.com today to access the full chapter.

Sunday
Oct112009

Are you Rolling Up?

One of the things that always drove me crazy with CRM 3 was when I had a problem and tracked it down only to find out there was a hotfix available.  Further, to get that hot fix I had to call up support and request the update.  Along the way, you would end up with 5-10 hot fixes that were required anytime you installed a client or server.  That became a headache real quick. Sure, there was a rollup for CRM 3 but there wasn’t a plan to keep the pace matching the users needs.  Microsoft heard that and with CRM 4 they have been doing Update Rollup’s on a regular scheduled basis.

Update Rollup’s are released every couple months and contain a set of by the Microsoft CRM Sustained Engineering team.  This was announced back in January here and has continued on with Update Rollup 6 being the current released rollup.  This doesn’t mean that you won’t ever need a hotfix, but it should reduce the need to manage as many special hotfixes. 

One thing I like a lot is you can choose how to introduce the rollup’s into your environment as it makes sense.  Some companies will apply the rollup as soon as it is released from Microsoft, while others might wait a quarter or only apply it if they have problems.  Each of the rollup’s are also broken out into client and server and other components.

 

Each Rollup has a KB article that details what was changed

 

Now don’t worry if you haven’t been rolling up there’s no need to go through each rollup you can jump straight to rollup 6 and start from there.  The prior rollup’s are not prerequisites.

CRM MVP Frank Lee also has a good blog post talking about approaches and good practices for deploying update rollups that you can read here.

So what do you think of the rollup’s?  Are they working for you?  What would you like different?

Monday
Aug242009

Silverlight 3 Jumpstart Book Released

I’m pleased to announce that our latest book Silverlight 3 Jumpstart has been released and now available for purchase.  Silverlight 3 Jumpstart is perfect for .NET Developers that want to get started learning about Silverlight.  The book is focused on the key parts of Silverlight that are relevant for business application developers. 

The book is an easy read that you can get through quickly without being intimidated.  Reference books are great, but spending too much time on an obscure feature when you’re getting started wastes your time. Silverlight 3 Jumpstart packages up the things I wish I could have had in a book when I started learning Silverlight a few years back.  Silverlight 3 also introduced a number of new business application friendly features that you learn as part of the book. In addition to covering the basics of Silverlight, we also take time to explore application architecture choices you will be making. 

As a thank you for your continued support - we wanted to offer you an opportunity to get a copy of the new book or an e-book copy. Using the following codes on www.silverlightjumpstart.com you can receive your special offer for the book.

By using code DaveCRMBlogPrint on the checkout page you can get a print copy of the book for only $19.99 or use this link http://www.silverlightjumpstart.com/Specials/SearchKeywordOffer.aspx?OfferCode=DaveCRMBlogPrint

By using code DaveCRMBlogEBook on the checkout page you can get an e-book copy of the book for only $14.95 or use this link http://www.silverlightjumpstart.com/Specials/SearchKeywordOffer.aspx?OfferCode=DaveCRMBlogEbook

Why should a CRM/xRM developer learn Silverlight?  Great question! Let me try to explain why I believe it should be on your top 10 list of technologies to learn now.  As a CRM/xRM developer you’re all about integration and building applications by connecting the dots.  You start with the core CRM platform and customize it to solve business problems.  Microsoft CRM does a good job of giving you a lot of customization points that can be done without writing a single line of code.  In fact, as the vNext version of Microsoft CRM is released I’m sure there will be even more things you can do without writing a line of code.  I also believe that as CRM is used more broadly beyond just customer relationship management that the need for even richer user experiences will continue to increase. 

Silverlight represents the great compromise between the smart client and the web application.  It gives developers the ability to interact with the user like a smart client but have deployment ease like expected with a web application.  In fact, I would hope as new version of products like CRM come out they include first class support for Silverlight.  You’re starting to see that trend already in SharePoint 2010.  You can see a glimpse of that in the following preview - click on the developer preview. http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/default.aspx. In the demo the Silverlight Web Part allows inclusion of Silverlight applications in a SharePoint site.  I think we will see this trend hit all the major integration platforms like CRM that offer easy extensibility.   In fact if you want to this can be done today, it just requires a little more work than might be possible in the future.  Having done both ASP.NET and Silverlight extensions to CRM/xRM solutions I find Silverlight to be much more productive now that I’ve gotten up to speed.

Like any new technology, don’t expect to be an expert overnight.  That’s why I’m suggesting starting now to learn and get comfortable.  You then can use Silverlight for increasingly larger projects as you get more comfortable.  This is a much better approach than all of a sudden trying to use it on some mission critical project with no room for a  learning curve.  Even if you decide you’re not ready to start coding, the Silverlight 3 Jumpstart book is a great way to understand more about how Silverlight fits into your application strategies.

Tuesday
May262009

Entity Framework Model to Dynamics CRM

I’ve been interested in a while to try to see if I could take a model from Entity Framework and push it into CRM using the Metadata API.  If your not familiar with ADO.NET Entity Framework, it was first released with .NET 3.5 SP1 and the second version of it is part of the upcoming VS2010/.NET 4 release.  You can separate out EF into two key parts the Entity Data Mode (EDM) and the Entity Framework API that’s used to work with the data using the EDM.  In working on my upcoming Silverlight book (http://www.slria.com) I’ve been looking at some different techniques for working with data across both traditional databases and CRM.  That seemed like the perfect excuse to spend a few minutes (ok a little longer than that) building a tool that would consume the Entity Framework Model and push it into a CRM Entity Model using the metadata API.

So to get started, I defined an EDM using the Course database that I’m using as part of my examples for the book.  The following is a snippet from the designer view of the EDM inside Visual Studio.  Wouldn’t it be nice if the CRM team provided us some modeling tools like this! 

image

Under the covers this stores in a .edmx file in your project which is really an XML file that contains the Conception Layer (What your application sees), the Storage layer (What it looks like in your database) and finally the Mapping layer which glues the two other layers together.  You could simply work with the XML but the Entity Framework provides a nice metadata API that you can load this up and walk through it in memory. 

Using the EF metadata API, I built a tool below to allow you to select entities from the model and push them to CRM.  The tool is still industrial, and very much a prototype at this point but once you select the entities it allows you to push both the entity and the attributes into CRM

 

image

It handles some basic things like putting in spaces in the names etc.  I still need to look more about descriptions and other useful things you might want to pull over but the basics end up in CRM.  The following is a simple snapshot of CRM after running the tool.

image

I’m thinking this type of capability could be interesting for a number of things.  In my example, I think it took about 10 minutes or so to do what would have taken me probably 5 hours to create all the duplicate definitions in CRM.  It might also be interesting to go the other way from CRM into the EDM to allow visualization of the CRM model inside Visual Studio.  I didn’t tackle that tonight, will save that for another day!

Saturday
Apr182009

New CRM 4 Virtual Machine Available

Microsoft just posted a new demonstration virtual machine to the PartnerSource portal.  This new Microsoft Dynamics CRM 4 Virtual Machine 2009 will replace the current one that is set to expire soon.  This new image has a lot of great improvements – top of my list is that it has Visual Studio 2008 and SQL Server 2008 on it!  It also has all the CRM 4 Accelerators, dashboards and other good stuff on it.

Currently, as far as I can tell you can only download the image from PartnerSource and there’s not a replacement in the public Microsoft download section yet.  Let’s hope Microsoft continues to support getting broad access to kick the tires on CRM and updates the public download.

The new VM is time bombed for August 2010.

Did you know about VM Express?  Apparently I didn’t , that is I have heard people talk about it, but just assumed they were using some fancy word for File downloads.  It turns out it’s really a Virtual Machine Demonstration Toolkit.  Anyway, apparently it’s this thing you can “Order” for a few $ (Yeah I don’t get that part) from the partner site that will make managing VM downloads etc easier.  Menno has a good blog post here that try’s to explain the “Magic”.  It also includes the “Magic” instructions needed to navigate the ordering process which without trust me you will NEVER find it on the site!  If your wanting to know if it’s any good – your guess is as good as mine, I placed my order and waiting for my package to arrive!

I did not wait however for it to arrive to download the new VM!

Tuesday
Mar102009

Could not find a Public, Static field with name 'xyz' of type DependencyProperty

When building custom workflow activities for CRM 4.0 pay attention to the names you give the dependency properties or you might just end up with this error.

Let’s look at a quick example of a dependency property

public static readonly DependencyProperty ResultProperty = DependencyProperty.Register
            ("Result", typeof(string), typeof(MyWorkflowType));

        [CrmOutput("Result")]
        public string  result
        {
            get
            {
                return (string)base.GetValue(ResultProperty);
            }
            set
            {
                base.SetValue(ResultProperty, value);
            }
        }

The part to pay attention to above is highlighted in red.  The code will compile fine but when you attempt to register it with CRM using the registration tool you will receive an exception.  The error will say “Could not find a Public, Static field with name “resultProperty” of type DependencyProperty.

Why’s this happen?  It appears that during registration MSCRM does a validation to ensure that you have a dependency property.  It expects the case of the name to be the same.  So in this case it wanted ResultProperty to be resultProperty with a lower case “r”.

Thursday
Mar052009

Workflow triggered by Update in error

Ran across an interesting error this week where a workflow was being triggered during an update even though the fields that were setup to trigger it were not modified.   I thought I was actually needing to have my eye’s checked but sure enough ,  the workflow would run 7 times retriggering itself, then the 8th time fail due to CRM detecting an infinite loop.

The good news is it’s curable, there’s a hot fix for this specific issue you can read about here

Thursday
Mar052009

Outlook and Diags Hang if AccessMode Administration

Was looking at a problem today for someone where Outlook wouldn’t install.  Diagnostics failed miserably or actually just hung part way through.   Turns out this can occur if the user is set to Access Mode = Administration instead of being set to a full user.  Simply changing the access mode for the user will correct this problem.

Page 1 ... 2 3 4 5 6 ... 21 Next 8 Entries »