Logo
CAR REVIEW
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
PREGNANCY
 
 
Windows Server

Microsoft Dynamics CRM 4.0 : Silverlight - Deploying Silverlight Using IFrames, Notes Entity

12/9/2012 5:03:12 PM

Deploying Silverlight Using IFrames

The most common way to integrate the Silverlight application is by using IFrames, which are located either in the main screen of the CRM (possibly used as dashboards) or inside the entity (such as an account summary, a rich note entity, and many others). To set up this feature in Microsoft Dynamics CRM, follow these steps:

1.
Open Microsoft Dynamics CRM.

2.
Click Customizations on the navigation menu on the left.

3.
Click Customize Entities.

4.
Open the Accounts entity.

5.
Click Forms and Views.

6.
Open the form.

7.
Click Add a Tab from the Common Tasks list located on the right side.

8.
Give it a name (for example, Silverlight Account Dashboard), and then click OK.

9.
Navigate to the new tab created.

10.
Click Add a Section and give it a friendly name (for example SilverlightSection). Then click OK.

11.
Select the newly created IFrame.

12.
Click Add an IFrame with the following properties:

Name: SilverlightIFrame

URL: http://<<siteURL>>

13.
Check the Pass Record Object-Type Code and Unique Identifier as Parameters check box.

14.
Click OK.

15.
Click Save and Close to save the form modifications.

16.
Click Save and Close to save the entity modifications.

17.
Click the Accounts entity, and then select Publish, to deploy the changes (see Figure 1).

Figure 1. IFrame Properties page.


Notes Entity

The built-in notes entity for Microsoft Dynamics CRM stores only the raw text with a date and timestamp. In addition, the notes entity is difficult to search, and you can’t copy and paste more than one note at a time. Silverlight can add a multimedia mask on top of the notes entity, which can potentially unlock other features, such as searching, copying and pasting, rich text formatting, inserting images, and much more. Silverlight can also provide a user-friendly interface for end users to view the notes and organize them graphically (see Figure 2).

Figure 2. Sample notes customization.

In any Silverlight application, there are two necessary components:

  • Access to the any data from the Microsoft Dynamics CRM system

  • A WCF web service layer

Then you build the Silverlight XAML file to add the snazzy user interface.

Building a WCF web service is like building a standard web service. All you need to do is declare a public function called GetNotesAsync. The GetNotesAsync function is responsible for accessing the related notes based on the AccountID of the current object. Add the following piece of code inside that function:

CrmSdk.CrmAuthenticationToken authToken = new CrmAuthenticationToken();
authToken.OrganizationName = "MicrosoftCRM";


CrmSdk.CrmService crmService = new CrmSdk.CrmService();
crmService.Credentials = System.Net.CredentialCache.DefaultCredentials;
crmService.CrmAuthenticationTokenValue = authToken;


QueryExpressionHelper qeHelper = new QueryExpression-Helper(EntityName.annotation.ToString());
qeHelper.Columns.AddColumn("subject");
qeHelper.Criteria.Conditions.AddCondition("objectid", ConditionOperator.Like, Request.QueryString["ObjectId"]);


BusinessEntityCollection annotationRetrieved = service.RetrieveMultiple(qeHelper.Query);


foreach (annotation annotationItem in annotationRetrieved.BusinessEntities)
     writer.Write(annotationItem.nptetext + "<BR>");

					  

Add the following lines in page.xaml:

<UserControl x:Class="CRMSL2B2.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="800" Height="600">
   <StackPanel x:Name="LayoutRoot" Background="White">
        <Button Width="240" Height="25" x:Name="btnGetNotes"
Click="btnGetNotes_Click" >
            <TextBlock>List Notes</TextBlock>
        </Button>
       <ListBox Height="500" Width="500" x:Name="dlNotes"/>
    </StackPanel >
</UserControl>

The “code behind” for button will look like this:

System.Windows.Browser.HtmlPage.Window.Alert("Loading...");


BasicHttpBinding bind = new BasicHttpBinding();
EndpointAddress endpoint = new EndpointAddress("http://<server>/CRMData/CRMWCF.svc");
DSvc.CRMWCFDataServiceClient client = new DSvc.CRMWCFClient(bind, endpoint);
client.getNotesCompleted += new EventHandler<CRMSL2B2.WDS.ListAccountsCompletedEventArgs>(client_getNotesCompleted);
client.GetNotesAsync();

					  

Note

It is recommended to add an additional web service layer for security and reliability reasons. Also, it is recommended to build applications loosely coupled and highly cohesive.


After the code has been compiled and deployed, you can integrate that into the CRM using IFrames.

Other -----------------
- Microsoft Dynamics CRM 4.0 : Silverlight - Developing a Basic Silverlight Application
- Windows Server 2008 Server Core : Outputting Data Files with the Type Command
- Windows Server 2008 Server Core : Replacing Existing Files with the Replace Utility, Taking Ownership of Files with the TakeOwn Utility
- Microsoft Dynamic GP 2010 : Tools for Dynamics GP
- Microsoft Dynamic GP 2010 : Purchase Order Processing
- Windows Server 2003 : Protecting Hosts with Windows Host Firewalls - Internet Connection Sharing
- Windows Server 2003 : Protecting Hosts with Windows Host Firewalls - Firewall Basics
- Collaborating Within an Exchange Environment Using Microsoft Office SharePoint Server 2007 : Exploring Basic MOSS Features
- Collaborating Within an Exchange Environment Using Microsoft Office SharePoint Server 2007 : Understanding the History of SharePoint Technologies, Identifying the Need for MOSS 2007
- Managing SharePoint 2010 with Windows PowerShell : Managing SharePoint 2010 Web Applications
- Managing SharePoint 2010 with Windows PowerShell : Managing Permissions in SharePoint 2010, Managing Content Databases in SharePoint 2010
- BizTalk 2010 : ASDK SQL adapter examples (part 4) - Composite Operations
- BizTalk 2010 : ASDK SQL adapter examples (part 3) - Query notification and multiple result sets
- BizTalk 2010 : ASDK SQL adapter examples (part 2) - Select, Table Valued Function, and Execute Reader
- BizTalk 2010 : ASDK SQL adapter examples (part 1) - TypedPolling and debatching
- Microsoft Dynamics AX 2009 : Integration with Microsoft Office - Sending email using Outlook
- Microsoft Dynamics AX 2009 : Integration with Microsoft Office - Exporting data to Microsoft Project
- Microsoft Content Management Server : The ASP.NET Stager Application (part 3) - Staging Attachments
- Microsoft Content Management Server : The ASP.NET Stager Application (part 2) - Staging Channels and Postings
- Microsoft Content Management Server : The ASP.NET Stager Application (part 1) - The DotNetSiteStager Project, Recording Messages to a Log File
 
 
Most view of day
- Evaluating Applications for Windows 7 Compatibility : Deploying XP Mode
- Windows Phone 8 : Orientation and the PhoneApplicationPage Class (part 3) - Setting Page Orientation at Runtime
- Windows Server 2008 : Configuring Server Core after Installation (part 4) - Setting the Time, Date, and Time Zone , Joining a Domain
- Conducting Research in OneNote 2010 : Researching a Topic, Customizing the Research Task Pane
- Windows Server 2008 : Configuring Server Core after Installation (part 3) - Logging Off, Shutting Down, and Rebooting
- Maintaining Security : Restricting Access on the Computer
- Sharepoint 2013 : New Installation and Configuration - SharePoint Products Configuration Wizard
- Windows Small Business Server 2011 : Disaster Planning - Preparing for a Disaster, Restoring from Backup
- Automating Windows 7 Installation : Customizing Images Using Deployment Image Servicing and Management (part 2) - Mounting an Image , Servicing Drivers in an Image
- Microsoft Excel 2010 : SUBTOTAL Function, Subtotal Tool
Top 10
- Windows Phone 8 : Scheduled Tasks - Scheduled Task API Limitations
- Windows Phone 8 : Scheduled Tasks - Updating Tiles Using a Scheduled Task Agent
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 5) - Editing an Existing To-Do Item
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 4) - Creating the To-Do Item Shell Tile, Saving a To-Do Item
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 3) - Debugging Scheduled Tasks
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 2) - TodoService, TodoItemViewModel
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 1) - TodoItem,TodoDataContext
- Windows Phone 8 : Scheduled Tasks - Using Scheduled Tasks
- Windows Phone 8 : Scheduled Tasks - Background Agent Types
- Windows Phone 8 : Windows Phone Toolkit Animated Page Transitions - Reusing the Transition Attached Properties
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro