Wednesday, December 31, 2008

Want to demo your Windows Mobile device on your PC?

– Eric Boocock Posted this

Download the Windows Mobile Developer Power Tools and perform the following manual steps*:

  1. Install Windows Mobile Developer Power Toys.
  2. Copy C:\Program Files\Windows Mobile Developer Power Toys\ActiveSync_Remote_Display\devices\wce400\armv4t\cerdisp2.exe and C:\Program Files\Windows Mobile Developer Power Toys\ActiveSync_Remote_Display\devices\wce400\armv4t\KillProc.exe to \Windows on the mobile device.
  3. Run ActiveSync Remote Display on the PC and click OK to the error.
  4. Choose Yes when the mobile device asks you if you want to run cerdisp.exe
  5. Below is an example screenshot of the Remote Display of Internet Explorer from Windows Mobile device.

clip_image002

* Steps taken from MVP Chris Rue’s blog.

Happy Demoing!

– Eric Boocock

Posted: Wednesday, December 31, 2008 12:26 PM by Eric Boocock

Are your CRM Window’s showing full URL and GUID? What to fix it

One of my clients, John Daley of Shiffler Equipment Sales, Inc, spent some time with Microsoft trying to fix a problem with CRM and IE after upgrading from CRM 3.0 to CRM 4.0.

The Problem: In 3.0 the IE windows would show the Contact or account names at the top and when minimize it would show on the minimized window title. After upgrading to CRM 4.0, the full URL showed first. This makes it hard to know which window to open if you have multiple CRM windows open.

ttilebar

John spent some time with CRM support and they ended up passing him over to Internet Explorer Support. In the end, the solution is simple.

  1. Open Internet Explorer -> Tools -> click on Internet options
  2. In the Internet options, choose Security Tab->Trusted site (Or Intranet site, depending where your CRM is placed), click Custom Level button.
  3. In Security window find section Miscellaneous and change setting for "Allow script initiated windows without size or position constraints" to Enable.
    SecuritySettings
  4. Click OK button to save changes and exit.
  5. Test any of the affected CRM entity  page again. We should see normal title bar now.

Calculate total activity duration for an Account, Contact or Opportunity

Posted: Friday, December 26, 2008 8:16 PM by Laura Robinson

With workflow you can easily calculate the total duration of all completed activities rolled up to a main record such as an Account, Contact or Opportunity.  This functionality is built into the service module, but for organizations that track number of hours spent on activities prior to service management (for example, consultants who bill hours prior to the sales transaction) it may be useful to create a custom workflow.

Step 1:

Add a custom attribute field for "Total Activity Duration" to your primary record.  In this example I will use the Account record.  If you do not know how to add a custom attribute, please view the video on Customizations (start at approx. min 1:30).  Because workflow increment calculations only work with number fields, I've made this an "int" type attribute.  Add the field to your Account form and publish the changes.  In this example I have also added a field "Last Activity Date" to time-stamp the most recent activity for the account.

image image

Step 2:

Create a custom workflow.  You will need a separate workflow for each activity type you want to calculate, such as phone calls and appointments - activities for which you want to track total duration.  In this example I will use the phone call activity.

Configure your workflow to start running when the activity record is created.  Set a wait condition as the first step to wait until the activity has been completed.  (If you are forecasting billed hours for the future, you may want to leave out the wait condition and instead set the workflow to update every time the activity duration is updated.  It's flexible.)

Update the related Account record attribute that you created in step 1 with "Increment by{Duration(Phone Call)}" in the "Total Activity Duration" field.  If you added the attribute "Last Activity Date", update this as well with the actual end date of the activity.

image image

Step 3:

Repeat for the other activities you want to track.  Final result:

image

NB: The increment by feature will calculate duration in terms of hours and then days, which can be cumbersome to report and compare for multiple records.  However, when you export the data to Excel it converts all duration values to minutes.

Posted: Friday, December 26, 2008 8:16 PM by Laura Robinson

Tuesday, December 30, 2008

You Got Mail (Or Not) Email Router Service fails to start

posted at: 9:19 AM by Aaron Elder wrote this

Recently, we recently had a power failure at one of our data centers which for a few reasons resulted in a hard shutdown of our CRM Server.  After the power came back on, the server started normally and everything seemed to be working well.  Normally that is, with the exception of the Microsoft CRM Email Router service, which failed to start.  The failure error was rather useful and the fix was rather easy.  Here is the error:

router issue

The E-mail Router service could not run the service main background thread. The E-mail Router service cannot continue and will now shut down.

System.Configuration.ConfigurationErrorsException: The E-mail router service cannot access system state file Microsoft.Crm.Tools.EmailAgent.SystemState.xml. The file may be missing or may not be accessible.

The E-mail Router service cannot continue and will now shut down. --->

System.Xml.XmlException: Root element is missing.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.Load(String filename)
   at Microsoft.Crm.Tools.Email.Providers.ConfigFileReader..ctor(String filePath, ServiceLogger serviceLogger)
   at Microsoft.Crm.Tools.Email.Providers.SystemState.Initialize(ServiceLogger serviceLogger)
   at Microsoft.Crm.Tools.Email.Agent.ServiceCore.InitializeSystemConfiguration()
   --- End of inner exception stack trace ---
   at Microsoft.Crm.Tools.Email.Agent.ServiceCore.
InitializeSystemConfiguration()
   at Microsoft.Crm.Tools.Email.Agent.ServiceCore.ExecuteService()

The key here is:

“The file may be missing or may not be accessible.”

The first questions to ask are “what file is missing or not accessible” and “where are you looking for it”.  The error tells us that the file in question is Microsoft.Crm.Tools.EmailAgent.SystemState.xml which I happen to know was located in the Email router folder, c:\Program Files\Microsoft CRM Email\Service.  (Of course if I didn’t know this, I could have searched for it or used a tool like FileMon to see where the service was trying to find it) 

Upon examining the state XML file, something was indeed not right:

Something is amiss

The solution in this case was to simply delete the file (or rename it) so that the service would create a new state file and continue working normally.

Fixing the file

Cheers,

This posting is provided "AS IS" with no warranties, and confers no rights.

posted at: 9:19 AM by Aaron Elder

“Poor man’s” Business Intelligence for Microsoft Dynamics CRM

CRM MVP Joel Lindstrom, a Solutions Consultant for CustomerEffective, blogs about BI solutions.

Business Intelligence (BI) is getting a lot of attention these days. It makes sense that companies want to use the data collected by business systems like Microsoft Dynamics CRM to make better decisions, be more effective and impact the bottom line. Technologies from Microsoft, such as SQL Server Reporting Services (SSRS), SQL Server Analysis Services (SSAS), and Performance Point have made BI more accessible and more affordable.

But where should a company that is just starting out with Microsoft Dynamics CRM start to “dig deeper” into their data? BI is more of a strategy than a technology, and there are several easy, inexpensive ways to analyze CRM data before spending the time and money to roll out a more complex BI platform.

1. “Advanced” Advanced Find. Anyone who has spent much time in Microsoft CRM is familiar with Advanced Find; however, from my experience, most users just tap the surface. Sure, Advanced Find can give you a list of Accounts where the Address 1: State/Province = “NY,” but it also can filter the list by virtually any related entity, so advanced find can be a pretty powerful BI tool. For example, with one advanced find you can get a list of all accounts in NY that have had a phone call in the current month where a contact is named “Frank.”

clip_image002

Advances Find is even more useful now that CRM 4.0 can display fields from other entities in the search results, and take your query into report builder to further enhance the output.

Advanced Find Considerations

As CRM users gain more experience with CRM, they typically come across some questions that Advanced Find alone cannot answer.

a. “NOT” questions—these are queries where you are looking for records where certain data does NOT exist. For example:

  • Which contacts have NOT been called in the past 3 weeks?
  • Which accounts ordered in 2007 but NOT in 2008?

The issue with “NOT” questions and Advanced Find is that Advanced Find queries the data that is in CRM. With a NOT question, you are looking for data that does NOT exist in CRM. In the case of a one-to-many relationship (such as orders related to accounts), if you search by “does not equal,” you will return any record that has a related record that does not equal the search criteria, even if another related record exists that does equal the search criteria.

For example, say I want to see which accounts ordered in 2007 but did not order in 2008, and I have an account that has two orders in history, one in 2007, and another in 2008. If I do the following advanced find:

clip_image004

This account would be returned because it has a related order that is NOT in 2008, even though it also has an order that IS in 2008.

b. Multi-step ad-hoc analysis—this is where you want to get a data set and slice and dice based on additional criteria. Once you perform an Advanced Find, you can save the query and run it again, or use it as the starting point for additional advanced find queries; however, sometimes there is a need to be able to get a data set and then further refine it based on additional criteria. For example, a sales manager may want to see everybody that has purchased product X, but then remove everyone who has also purchased product Y.

So where do we go when advanced find doesn’t get us there?

2. Marketing Lists—they’re not just for campaigns anymore.

Marketing list functionality in Microsoft CRM takes advanced find to the next level. One really powerful feature of a CRM Marketing List is the ability to not only add members to a list based on an advanced find, but also being able to use additional advanced find queries to further refine the members of the list. You can:

  • Add Members
  • Remove Members
  • Evaluate Members

Say that you want to see a list of Accounts that have ordered in 2007 but have NOT ordered in 2008:

Step 1: Create a new marketing list, selecting Account as the member type

clip_image006

Step 2: Click the Marketing List Members navigation bar link and click the “Manage Members” button.

clip_image008

Step 3: On the Manage Members form, select “Use Advanced Find to Add Members.” In your advanced find, select Accounts where related Order submitted date is after 1/1/2007 and before 12/31/2007. This will return a list of all accounts that ordered in 2007.

Step 4: Click the “Manage Members” button and select “Use Advanced Find to Remove Members.” In your advanced find, select Accounts where related Order submitted date is after 1/1/2008 and before 12/31/2008

The resulting list will include all accounts that ordered in 2007 but did NOT order in 2008. So now say that the sales manager sees the list, and he wants to further refine it to only include those companies that have purchased product X. He can now further refine the marketing list to only include accounts that meet those criteria:

Step 5: Click the “Manage Members” button and select “Use Advanced Find to Evaluate Members.” In your advanced find, select Accounts where the related Order’s related Order Product equals Product X

clip_image010

Evaluate Members compares the Marketing List Members to the results of an advanced find and removes any members from the list that are not returned by the advanced find results. Now the list will include only the accounts that ordered in 2007 but did NOT order in 2008, where the ordered product equals Product X.

Marketing list provide very powerful, yet easy to use out of the box functionality to slice and dice your customer data.

Marketing Lists Considerations

The main limitation of marketing list functionality is that marketing list members can only include Accounts, Contacts, and Leads. You cannot create marketing lists of custom entity records.

3. “Excel”-erate your CRM data

There is good reason why the most widely used business intelligence application in the world in Microsoft Excel. It is affordable, it is ubiquitous, and it is easy to use. And it is also very easy to interface Excel with your CRM data. You can connect directly to the CRM data source and do very complex queries from Excel; however, you don’t have to go that far to analyze your CRM data with Microsoft Excel.

The most basic interface between CRM and Excel is the export to Excel button that is found on any view in Microsoft Dynamics CRM (even on the marketing list we built in #2).

clip_image012

As with Advanced Find and Marketing lists, I have found that many users have a basic understanding of the export to Excel functionality, but don’t see some of the real power of taking your CRM data into Excel.

For example, take the process of territory rationalization. Company X has grown from a small company with 2 salespeople to a larger sales staff. When they started, they didn’t really have well defined territories, but now that they have grown, the sales manager wants to organize the sales rep’s territories by state. To do so, she wants to see where each rep has the biggest concentration of accounts to figure out the best way to draw the territory lines.

She wants to find out which sales representatives have accounts in North Carolina who also have accounts in South Carolina.

Step 1: Export the “Active Accounts” view to Excel, selecting the “Dynamic Pivot Table” option and selecting the following attributes:

  • Account Owner
  • State/Province

Step 2: Create the pivot table, selecting owner for the rows, State/Province for the columns, and accountid for the Value.

clip_image014

Step 3: Filter the Pivot Table data using Excel’s filtering capabilities. This is somewhat tricky—at first it appears that you cannot filter the columns in the pivot table; however, it can be done.

a. In Excel 2007, select the data tab

b. Click on a cell directly outside of the pivot table

c. Click the advanced filter button. The cell range of your pivot table should auto-populate. If it does not, you can fill it in.

d. Click the filter button—you should now see the excel drop-down filters on each of the pivot table column headers.

See a screencast of how to use advanced filter with pivot tables.

Now the sales manager can filter both the SC and NC column to NOT show blanks, and return a list of every sales rep with accounts in NC and SC. She can then continue to slice and dice the list based on geographic criteria. This is just a simple example—once you get your data into Excel, you can perform very complex analysis of your data.

The point of my post is that you do not have to delay implementing a business intelligence strategy with Microsoft Dynamics CRM if you don’t have the time or resources to invest in a BI platform. I would encourage you to become more familiar with the out of the box analytical capabilities of Microsoft Dynamics CRM. These tools will not satisfy every BI requirement, but they are a great way to quickly dig into CRM data and get some quick wins without having to invest a lot of time, money or resources. They can give you an easy, affordable way to determine what questions you should be asking so you will be ready for a more complex business intelligence platform when the time is right.

Cheers,

Joel Lindstrom

CustomerEffective blog

Published Monday, December 29, 2008 9:17 AM by crmblog

Just do it – Deleting attributes that are in use by running Workflows

Microsoft Dynamics CRM MVP Aaron Elder of Ascentium provides some tips and tricks.

Recently, we had the need to delete several attributes from an entity we had created (Employee).  Normally this is a very straight forward affair in Microsoft CRM.  You simply remove the field from the Form and Grids and they using the Entity Editor select the attribute and hit “delete”.  In this case, the attributes in question, were being used by workflow.  Unfortunately, the error you get from CRM is not terribly helpful:

WF - Delete Error

While the steps to take are indeed correct and actually rather useful, the error does nothing to tell you which Workflow is causing the problem.  This was especially a problem for us because we happened to have almost 20 workflows running on the Employee entity and unpublishing and hunting through each of these would have been a real pain.  Of course with a little bit of SQL, there is a better way:

   1: -- Run this against your Org_MSCRM database 


   2: DECLARE @EntityYouAreTryingToModify VARCHAR(50) 


   3: DECLARE @AttributeYouAreTryingToDelete VARCHAR(50) 


   4: -- TODO: Update these to the entity and attribute you are working with 


   5: SET @EntityYouAreTryingToModify = 'invoke_employees' 


   6: SET @EntityYouAreTryingToModify = 'invoke_hardwaremacintoshdesktop' 


   7: SELECT    WFD.WorkflowDependencyId AS 'workflowdependencyid', 


   8:         WF.Name FROM WorkflowDependency AS WFD 


   9:     -- Join out to the Workflow Table to get the Name of the Workflow 


  10:     JOIN Workflow AS WF ON 


  11:         WFD.WorkflowId = WF.WorkflowId AND 


  12:         WF.StateCode = 1 


  13:     WHERE 


  14:         WFD.DeletionStateCode = 0 AND 


  15:         WFD.DependentEntityName = @EntityYouAreTryingToModify AND 


  16:         WFD.DependentAttributeName = @EntityYouAreTryingToModify AND 


  17:         WFD.Type = 8 AND 


  18:         WF.DeletionStateCode = 0


This query, will return a list of the Workflows that are currently published and that have a dependency to the field you are trying to delete.



Now that you know what Workflows are causing the problem, the steps to fix this are pretty simple:




1. Unpublish the Workflow(s)



2. Remove the dependency (In the “Properties” of a Step, the “Record Attributes Change” list, etc)



3. Re-publish your Workflow



4. Delete your attributes




Now, if you happen to instead:




1. Unpublish the Workflow(s)



2. Delete the Attribute



3. And try to re-publish the Workflow(s)




WF - PublishError



You are going to run into a “Generic” error when you try to re-publish the Workflow.  This is because the CRM delete attribute process is smart enough to delete the dependencies from part of the Workflow, but not all.  If you find yourself in this situation, don’t worry… just open the Workflow editor using the User Interface, remove the dependency and “re-save” it.



WF - Editor



The Workflow UI XML and various other XMLs will get “re-updated” with the dependency removed.  You can now re-publish the workflow and all should be well.



Cheers,



Aaron Elder



This posting is provided "AS IS" with no warranties, and confers no rights.



Published Tuesday, December 30, 2008 8:35 AM by crmblog

Monday, December 29, 2008

Update Rollup 1 for Microsoft Dynamics CRM 4.0 (More Info)

Matt Brown Published Tuesday, December 23, 2008 10:02 AM

Update Rollup 1 for Microsoft Dynamics CRM 4.0

The Microsoft Dynamics CRM Sustained Engineering team released Microsoft Dynamics CRM 4.0 Update Rollup 1 on Monday, November 24, 2008.

Below is the link to the release and information on how to deploy it to your clients via AutoUpdate. Please see the Knowledge Base (KB) article for more details about the Update Rollup 1 content and instructions. The Update Rollup 1 client can be deployed before the server is upgraded to Update Rollup 1.

Making Update Rollup 1 available to your clients via AutoUpdate:

You can find more information about AutoUpdate in Eric Newell’s blog entry at http://blogs.msdn.com/crm/archive/2008/05/08/crm-client-autoupdate.aspx.

If you have a direct internet connection from your client machines, you can avoid some of the configuration steps and use the linkID directly. Below are the necessary steps to configure the AutoUpdate for Update Rollup 1.

Note: These are steps 5, 6 and 7 of Eric’s blog.

1. Create the configuration XML file and save it.

<ClientPatches>

   <Create>

<!--- *** UR1 PATCH -->

        <ClientPatchInfo>

          <PatchId>{9D28D100-595D-4CC4-AE00-6A90913B968D}</PatchId>

          <Title>Update Rollup 1 for Microsoft Dynamics CRM 4.0 (KB 952858)</Title>

          <Description>Update Rollup 1 for Microsoft Dynamics CRM 4.0 (KB 952858)</Description>

          <!--- *** This will make it Mandatory -->

          <IsMandatory>true</IsMandatory>

          <IsEnabled>true</IsEnabled>

          <ClientType>OutlookLaptop, OutlookDesktop</ClientType>

          <LinkId>136466</LinkId>

      </ClientPatchInfo>

   </Create>

</ClientPatches>

2. From the command prompt, go to the directory where the ClientPatchConfigurator.exe is located ([ServerInstallDir]\Tools and type microsoft.crm.tools.clientpatchconfigurator.exe [configfile].xml

3. Once the patch has been uploaded, launch the Outlook client

The dialog should now appear saying that “Update Rollup 1 for Microsoft Dynamics CRM 4.0 (KB 952858” is available. If the <IsMandatory> is set to false, the client will only see the update if the user selects “Check for Updates” via the CRM Menu in the Outlook client.

Happy Holidays!

Matt Brown

Adding Notes to a Workflow E-mail

Posted by Jim Steger on December 23, 2008

In a recent post on the Microsoft Dynamics CRM Team blog, I discuss how you can easily overcome some of the native limitations of the CRM workflow Send E-mail action with some simple workflow assembly classes. Recently, I have been implementing the new eService Accelerator for our own corporate web site and came across a need for another CRM workflow e-mail utility...the ability to include all the notes of a record into the body of a workflow e-mail.

To accomplish this, I created a new activity class within my workflow utilities project and used the following code:

using System;
using System.Workflow.ComponentModel;
using System.Workflow.Activities;
using System.Web.Services.Protocols;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.SdkTypeProxy;
using Microsoft.Crm.Sdk.Query;
using Microsoft.Crm.Workflow;
using System.Collections;
using System.Text;

namespace SonomaPartners.Crm.Workflow.Utilities
{
[CrmWorkflowActivity("Format Notes", "Utilities")]
public partial class FormatNotes : SequenceActivity
{
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
IWorkflowContext ctx = contextService.Context;
ICrmService service = ctx.CreateCrmService();

this.FormattedNotes = BuildNotesString(service, ctx.PrimaryEntityId);

return base.Execute(executionContext);
}

public static DependencyProperty FormattedNotesProperty = DependencyProperty.Register("FormattedNotes", typeof(string), typeof(FormatNotes));
[CrmOutput("Formatted Notes")]
public string FormattedNotes
{
get { return (string)base.GetValue(FormattedNotesProperty); }
set { base.SetValue(FormattedNotesProperty, value); }
}


private string BuildNotesString(ICrmService service, Guid id)
{
StringBuilder results = new StringBuilder();
results.Append("Notes:<br>");

BusinessEntityCollection notes = new BusinessEntityCollection();
notes = RetrieveNotesForId(service, id);

foreach (annotation note in notes.BusinessEntities)
{
results.Append(string.Format("{0}<br>", note.subject));
results.Append(string.Format("{0}<br><br>", note.notetext));
}

return results.ToString();
}

private BusinessEntityCollection RetrieveNotesForId(ICrmService service, Guid id)
{
QueryByAttribute query = new QueryByAttribute();
query.EntityName = "annotation";
query.ColumnSet = new ColumnSet(new String[] { "subject", "notetext", "createdby", "createdon" });

query.Attributes = new String[] { "objectid" };
query.Values = new Object[] { id };
query.Orders = new ArrayList();
query.Orders.Add(new OrderExpression("createdon", OrderType.Descending));

try
{
RetrieveMultipleRequest request = new RetrieveMultipleRequest();
request.Query = query;

RetrieveMultipleResponse returnedNotes = (RetrieveMultipleResponse)service.Execute(request);
return returnedNotes.BusinessEntityCollection;
}
catch (SoapException ex)
{
throw new Exception(ex.Detail.InnerText);
}
}
}
}


Now, your e-mail includes any notes in the body of the message as shown here:



Feel free to download the Visual Studio 2008 workflow utilities assembly solution file.



Btw, I also wanted to thank Steve Kaplan and Jim Glass for allowing me to contribute on the Microsoft Dynamics CRM Team blog.





Posted by Jim Steger on December 23, 2008 | Permalink

Sunday, December 28, 2008

Microsoft Dynamics CRM 4.0 BizTalk Adapter Now Available

The Microsoft BizTalk® Server 2006 adapter for Microsoft Dynamics® CRM 4.0 is now available. This adapter has the same functionality as the previously released 3.0 adapter, with the following updates:

  • Supports both 32-bit and 64-bit deployments of Microsoft Dynamics CRM 4.0
  • Supports form-based authentication
  • Supports multi-tenancy

With this adapter, you can integrate Microsoft Dynamics CRM 4.0 with any other non-Microsoft business application using the BizTalk server mapping capabilities, which allows you to discover and use the schema of any of the Microsoft Dynamics CRM entities.

Adapter is available at no additional charge and can be downloaded from here.

Sanjay Jain

Microsoft Dynamics ISV Architect Evangelist

BlogsTeam’s Blog + Sanjay’s Blog

Friday, December 19, 2008

Customizing the Report Wizard Template

Posted by Jim Steger on November 21, 2008

The report wizard functionality of Microsoft Dynamics CRM 4.0 allows end users to quickly and easily create basic Reporting Services reports. After the user completes the wizard, CRM creates an RDL file that can then be rendered within the CRM Reporting Services viewer. A common question we get is how to change the template used by the report wizard. Well, my colleague, Brian, found a solution to this request. In this post, we discuss how to add your company logo to the report template used by the wizard.

Note: This approach is definitely unsupported, so use at your own risk!

We will go through the following steps to update the template:

  1. Backup the existing template
  2. Create a simple tool to extract the template from the database
  3. Customize the template by adding our logo to the header
  4. Import the template back to the SQL database

Step 1 - Backup existing template

The report wizard template is located in the body field of the ApplicationBaseFile table within the _MSCRM database. We recommend that you back up this data prior to any alterations. You can do this simply by executing the following SQL statement in the _MSCRM database which creates a backup table in your _MSCRM database to store the template data:

select body into dbo.ApplicationFileBase_Backup from ApplicationFileBase



Creating your own tables within the _MSCRM database is typically frowned upon, so you could instead copy this to a backup table in another database.

Step 2 - Extract template from SQL

Unfortunately, since SQL Management Studio limits its output to 64KB, retrieving the template is not as simple as just selecting the body text and copy and pasting into your favorite XML editor. While there are a number of ways to accomplish this, we decided to write a very simple .NET application to extract the template. Create a console application in Visual Studio, and paste in the following code. Be sure to update the sqlServerName and databaseName variables with your information. Run the application and your template will be saved on the c: drive in a file called report_template.xml.

using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.IO;

namespace CrmExtractTemplate
{
class Program
{
static void Main(string[] args)
{
//update the sql server name
string sqlServerName = "sqlserver";
string databaseName = "organization_mscrm";
string connectionString = String.Format("Data Source={0};Initial Catalog={1};Integrated Security=SSPI", sqlServerName, databaseName);

SqlConnection conn = new SqlConnection(connectionString);
conn.Open();

string sqlText = "select body from applicationfilebase";
SqlCommand cmd = new SqlCommand(sqlText);

cmd.Connection = conn;
cmd.CommandType = CommandType.Text;

SqlDataReader rdr = cmd.ExecuteReader();

while (rdr.Read())
{
TextWriter log = TextWriter.Synchronized(File.AppendText(@"c:\report_template.xml"));
log.Write(rdr["body"].ToString());
log.Close();
}
}
}
}

Step 3 - Add your logo to the template file

The report wizard template is a custom XSL stylesheet that CRM uses to transform into a valid RDL file. To update it, you need to find the actual RDL code, which is located within the <Report> node. This area contains all of the RDL XML. The default template doesn't include a <PageHeader> node, so you need to add one with your image information.

Now that you know where in the template file to add the image, you need to determine what XML to add. The easiest way to do that is to actually create a new report in a tool like Visual Studio .NET or Business Intelligence Design Studio. Also, by creating it first in a tool, you can be sure of the placement and sizing settings.

You can add an image as an external link or embed it in the report. The code for an external image would look similar to:

<PageHeader>
<PrintOnFirstPage>true</PrintOnFirstPage>
<ReportItems>
<Image Name="image1">
<Sizing>AutoSize</Sizing>
<Width>4.01042in</Width>
<MIMEType />
<Source>External</Source>
<Style />
<Value>http://www.sonomapartners.com/images/logo.jpg</Value>
</Image>
</ReportItems>
<Height>0.79167in</Height>
<PrintOnLastPage>true</PrintOnLastPage>
</PageHeader>

However, if the image is small enough, you could also choose to embed it in the report. To do this, you would not only add the <PageHeader> node as shown before, but also add an <EmbeddedImages> node with the image. The code for the embedded image approach would look similar to:

   <PageHeader>
<PrintOnFirstPage>true</PrintOnFirstPage>
<ReportItems>
<Image Name="Image15">
<Source>Embedded</Source>
<Value>sonomalogosmall</Value>
<Sizing>AutoSize</Sizing>
<Width>4.01042in</Width>
</Image>
</ReportItems>
<Height>0.79167in</Height>
<PrintOnLastPage>true</PrintOnLastPage>
</PageHeader>

<EmbeddedImages>
<EmbeddedImage Name="sonomalogosmall">
<MIMEType>image/jpeg</MIMEType>
<ImageData>
/9j/4AAQSkZJRgABAQEAYABgAAD... remaining encoded image removed for brevity
</ImageData>
</EmbeddedImage>
</EmbeddedImages>

This code can be placed anywhere within the parent <Report></Report> node in the template file.


Step 4 - Import the template file back to SQL Server

Luckily, you don't need to rely on .NET to get the file back into SQL Server. Copy your template file to the c:\drive of your SQL Server, and then from SQL Management Studio, execute the following SQL:

create table dbo.ApplicationFileBase_tempLoad
(
Body xml
)
insert ApplicationFileBase_tempLoad (body) 
select BulkColumn from openrowset( bulk 'C:\Report_Template.xml', Single_Blob) as Body
update ApplicationFileBase
set Body = (select top 1 convert(nvarchar(max), Body) from ApplicationFileBase_tempLoad)

drop table dbo.ApplicationFileBase_tempLoad

Now when you create a new report wizard, your new logo appears in the top left corner of the report!

 

Custom Workflow Activity - Add to Marketing List

Wednesday, 22 October 2008 Posted by Chris Cohen

I needed to use workflow to add a new member to a marketing list, but found I needed to create a custom workflow activity to do this. In fact once you have VS2005 setup with workflow project types it wasn't too hard.

You need to use Dependency Properties to pass parameters in (and out). The worflow activity form assistant will allow you to set some dynamically. You can use the context to get a handle to the crmService. CrmWorkflowActivity defines the menu labelling in the workflow activity.

Use the Developer PluginRegistration tool to register it, or there is sample installer code in the SDK workflow walkthrough.

Hope this helps someone.


using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.SdkTypeProxy;
using Microsoft.Crm.Workflow;

namespace Vizola.VEMWorkflow
{
[CrmWorkflowActivity("Add to Marketing List", "VEM Workflow")]
public partial class Add2ML: SequenceActivity
{
public static DependencyProperty listIdProperty = DependencyProperty.Register("listId", typeof(Lookup), typeof(Add2ML));
[CrmInput("Marketing List")]
[CrmReferenceTarget("list")]
public Lookup listId
{
get
{
return (Lookup)base.GetValue(listIdProperty);
}
set
{
base.SetValue(listIdProperty, value);
}
}
public static DependencyProperty contactIdProperty = DependencyProperty.Register("contactId", typeof(Lookup), typeof(Add2ML));
[CrmInput("Contact")]
[CrmReferenceTarget("contact")]
public Lookup contactId
{
get
{
return (Lookup)base.GetValue(contactIdProperty);
}
set
{
base.SetValue(contactIdProperty, value);
}
}
public Add2ML()
{
InitializeComponent();
}
///
/// The Execute method is called by the workflow runtime to execute an activity.
///

/// The context for the activity
///
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
// Get the context service.
IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
IWorkflowContext context = contextService.Context;
// Use the context service to create an instance of CrmService.
ICrmService crmService = context.CreateCrmService(true);

AddMemberListRequest amReq = new AddMemberListRequest();
amReq.EntityId = contactId.Value;
amReq.ListId = listId.Value;
AddMemberListResponse amRes = (AddMemberListResponse)crmService.Execute(amReq);

return ActivityExecutionStatus.Closed;
}
}
}

Using a Custom Database for reporting queries

Posted by Chris Cohen at 09:41

Very often you need to create custom reports, and sometimes the queries are non-trivial. At this point you need to create a custom database because this keeps you supported (MS) and simplifies maintenance - particularly in multi-tenant scenarios. Note: This article assumes that all relevant databases are on the same server.

But what about security and other settings - what do you need on your custom database?

If you are basing your custom reports on the stock ones (or otherwise), you may also find it very useful to keep using the common shared datasource. You are then easily able to return tenant-specific formats, culture info etc.

This all seems a bit of a nightmare to wade through. How can you do this? Well, it is possible, and this article shows you how, based on my own experience...

First of all, consider the collation of your custom database and make it the same as your tenant databases (CI_AI). If you don't you will later have collation compatibility issues that you don't want or need.

Next, users, roles and security. You need to make users and give roles to both network service and CRM reporting group. You can use the following script to do this:

USE [CUSTOMDB]
GO
CREATE USER [NT AUTHORITY\NETWORK SERVICE] FOR LOGIN [NT AUTHORITY\NETWORK SERVICE] WITH DEFAULT_SCHEMA=[dbo]
EXEC sp_addrolemember 'db_owner',[NT AUTHORITY\NETWORK SERVICE]
GO
DECLARE @SQLAccessGroup VARCHAR(255)SELECT TOP 1 @SQLAccessGroup=name FROM sys.server_principals WHERE CHARINDEX('SQLAccessGroup',name)<>0
EXEC ( 'CREATE USER [' + @SQLAccessGroup + '] FOR LOGIN [' + @SQLAccessGroup + ']' )EXEC ( 'sp_addrolemember ''db_owner'', [' + @SQLAccessGroup + ']' )
GO

So now you have your custom database setup and ready to populate with views, stored procedures, functions etc. If you are working in a multi-tenant environment (or even otherwise), and want to keep the standard shared datasource, you should aim to pass in the organization name from your report, apart from any other parameters. Consider using a query similar the following in each report.

<Query>
<DataSourceName>CRM</DataSourceName>
<CommandText>
DECLARE @orgname Varchar(100)
SELECT @orgname = Name FROM OrganizationBase
EXEC [CUSTOMDB].dbo.usp_customsp @orgname, @filter
</CommandText>
<QueryParameters>
<QueryParameter Name="@filter">
<Value>=Parameters!CRM_xxxxxxxxxxxxxxxxx.Value</Value>
</QueryParameter>
</QueryParameters>
</Query>

The final piece of the puzzle is creating a function in your custom database to return the specific tenant's database name. You can use this in your dynamic SQL to retrieve your query information from the right database.

CREATE FUNCTION [dbo].[GetDBName] ( @orgname varchar (100))RETURNS varchar (100)AS BEGIN
DECLARE @dbname varchar (100)
SELECT @dbname = DatabaseName FROM MSCRM_CONFIG.dbo.Organization WHERE (UniqueName = @orgname) OR (FriendlyName = @orgname)
RETURN @dbname
END
GO

For anyone who is starting to write custom reports, this information would have saved me a lot of time. I hope it helps someone?

Creating a customized Plug-in Template for Microsoft Dynamics CRM 4.0

Published Tuesday, December 09, 2008 8:34 AM by crmblog

Today we welcome MVP Bill Ryan from CustomerEffective as our guest blogger.

In its basic form, CRM 4.0 Plugin development is straightforward, however it has many monotonous elements. This walkthrough on writing Plugins illustrates many of the repetitive tasks that plugin development entails.  Among them are:

  • Creation of a new Class Library Project
  • Renaming of the default class (class1.cs or class1.vb to Plugin name)
  • Adding references to the Microsoft.Crm.Sdk & Microsoft.Crm.SdkTypeProxy libraries
  • Aliasing those libraries
  • Making the class inherit from the IPlugin interface
  • Adding the methods for that interface (or letting VS do it for you)

Most of these items are pretty simple to do, but it is monotonous and you have to remember to do it each time.  However most non-trivial plugins require some sort of configuration information.  Because plugins are dynamic link libraries hosted by CRM (and typically stored in the database), you can't use Settings.config,app.config or web.config files like you would in most other projects.  If you need this functionality, you need to roll your own solution. 

Fortunately, when you register each step for your Plugin, the PluginRegistration tool gives you two sections, one for an unsecured configuration and one for Secure Configuration.  But unless you write code to do something with this information, simply storing it will provide no benefit. (Mitch Milam has an excellent introduction to this).  To take advantage of configuration information, you need to add a new constructor to your plugin and then write code to read the settings.

You can just copy and paste his code if you'd like, but in all likelihood you'll probably want to write something specifically suited to your needs. Normally this would be something you'd just create in a library and attach as a reference to your project. However because of the plugin registration process, you'll typically want to work with as few dll's as possible (assemblies which reside in the Global Assembly Cache are an exception to this because you don't need to do anything special to use them).

Anyway, I found myself copying and pasting the same  class over and over into each plugin I wrote and it was something that got old quickly. Additionally, when ever developers come on board who aren't familiar with Plugin development, they will typically get stuck making the same mistakes you made when you first started writing plugins, something which can cost a lot of time and frustration.

Read more for Bill's solution...

Cheers,

MVP Bill Ryan

Use Shared Data Source for custom Microsoft Dynamics CRM reports

Published Wednesday, December 03, 2008 9:04 AM by crmblog

Meet guest blogger Jim Wang, Microsoft Dynamics CRM MVP. He is a technical consultant working for 2B.net, an UK based consulting company. He has been working on Microsoft Dynamics CRM since version 1.2.

Recently I have been asked to modify some reports. In my current project we have 4 environments (Development, Training, UAT, and Production) and we have custom reports for each environment. The reports for each environment are different because the data source is different. So the deploy administrator complain about numbers of report. They come and ask me if there is a way to have one report for all environments.

So this is how I did it:

If you have a look the CRM reports in report manager, there is a Data Source call: MSCRM_DataSource
I have noticed that actually all CRM reports use this data source, so why can’t I use it for our custom reports? I think it shouldn’t be a problem.

In Visual Studio, open the report project, Add a Shared Data Sources call: MSCRM_DataSource, it is important to keep it as same as CRM’s. The connection string just uses the development environment, e.g.: Data Source=crm;Initial Catalog=org_MSCRM

Once finished, upload the report RDL file using the Report Manager, e.g http://crm/reports.

See how Jim solves this challenge...

Cheers

Jim Wang

Invalid Argument error when importing unpublished entities

Posted by David Jennaway at 19:45

If, like I did recently, you export an entity before it has been published, you will get an 'Invalid Argument' error when importing the entity if it has any relationships.

The reason for this is that the relationship attribute will have no display name, which results in the error. The simplest solution would be to go back to the original deployment, publish the entity, then export again. But, if that's not an option, you can fix the problem within the exported xml as follows:

The invalid relationship xml will look like the following:

<field name="pjv_targetid" requiredlevel="required" imemode="auto" lookupstyle="single" lookupbrowse="0">
<displaynames />
</field>


The problem is that the displaynames element is blank. This can be changed to something like the following

<displaynames>
<displayname description="Target" languagecode="1033" />
</displaynames>


The languagecode attribute will need to be set to the correct value for your deployment. Many other elements will have this value set in the customizations.xml file

Create Activities using the Dynamic Entity Way

Posted by Darren Liu at 11:17 AM

I haven't touch CRM SDK for a while since I am working on another project not directly related to CRM. One of my old client required us to populate CRM with some more training data so they can use it for their training. So I have to modify the training processor that my teammates wrote to add activities to CRM. It appears to me that everything in the training processor have used Dynamic Entity for create, update, and delete.

To create an activities using the dynamic way is pretty straight forward, however I got stuck when I have to deal with the sender and recipient fields on a phone call, email, appointment and fax activities. Sender and Recipient field are ActivityParty type, I done some research online and I was not able to find a way to associate the two fields to an activity using the dynamic approach. After going through the SDK and I was able to figure it out. I would like to share it since you might have to do the same in your next project.

Method 1: Not using Dynamic Entity

activityparty actParty = new activityparty();
actParty.partyid = new Lookup();
actParty.partyid.Value = new Guid("ENTER CONTACT GUID");
actParty.partyid.type = "contact";

activityparty actParty2 = new activityparty();
actParty2.partyid = new Lookup();
actParty2.partyid.Value = new Guid("ENTER USER GUID");
actParty2.partyid.type = "systemuser";

phonecall call = new phonecall();
call.from = new activityparty[] { actParty };
call.to = new activityparty[] { actParty2 };
call.description = "Test";

crmService.Create(call);



Method 2: Using Dynamic Entity




Property subject = new StringProperty();
((StringProperty)subject).Name = "subject";
((StringProperty)subject).Value = "Test";

Property description = new StringProperty();
((StringProperty)description).Name = "description";
((StringProperty)description).Value = "Test";

// Create From:
Property party1 = new LookupProperty();
((LookupProperty)party1).Name = "partyid";
((LookupProperty)party1).Value = new Lookup();
((LookupProperty)party1).Value.type = "contact";
((LookupProperty)party1).Value.Value = new Guid("ENTER CONTACT GUID");

DynamicEntity actParty1 = new DynamicEntity();
actParty1.Name = "activityparty";
actParty1.Properties = new Property[] { party1 };

DynamicEntityArrayProperty from = new DynamicEntityArrayProperty();
((DynamicEntityArrayProperty)from).Name = "from";
((DynamicEntityArrayProperty)from).Value = new DynamicEntity[] { actParty1 };

// Create To:
Property party2 = new LookupProperty();
((LookupProperty)party2).Name = "partyid";
((LookupProperty)party2).Value = new Lookup();
((LookupProperty)party2).Value.type = "systemuser";
((LookupProperty)party2).Value.Value = new Guid("ENTER USER GUID");

DynamicEntity actParty2 = new DynamicEntity();
actParty2.Name = "activityparty";
actParty2.Properties = new Property[] { party2 };

DynamicEntityArrayProperty to = new DynamicEntityArrayProperty();
((DynamicEntityArrayProperty)to).Name = "to";
((DynamicEntityArrayProperty)to).Value = new DynamicEntity[] { actParty2 };

 

// Create Phone Call Activity:
DynamicEntity activity = new DynamicEntity();
activity.Name = EntityName.phonecall.ToString();
activity.Properties = new Property[]{subject, description, from, to};

TargetCreateDynamic target = new TargetCreateDynamic();
target.Entity = activity;

CreateRequest request = new CreateRequest();
request.Target = target;

CreateResponse response = (CreateResponse)crmService.Execute(request);




That's it! Hope this will help you in your next project! :)

Customize Marketing List (List Member View) (EASY WAY)

Microsoft Dynamics CRM Team Blog posted this

The ability to Customize the List Member View of a marketing list has not been made available in the Customization area of the UI, but can still be achieved with the UI in other means by using the Advanced Find feature.

clip_image002
Fig 1: Marketing List Detail Form displaying “List Member View”

A Marketing List can only be 1 of 3 types, an Account, Contact, or Lead. By default each of these 3 entities has a view associated with it named “All Members”, "Active Members", and "Inactive Members". The view that is displayed for the List Member View is based on the marketing list type. For example if the List is an Account type Marketing List, then only the Account entity views of “All Members”, “Active Members”, and “Inactive Members” will be available. The Lead and Contact entities also has these three views, but they will not be available to a Marketing List of type Account.

I will provide an example below of adding a single column only to the “All Members” view for all 3 entities, “Account”, “Contact”, and “Lead” for a total of 3 view modifications. Note: You must have permissions for Customizations to perform the following steps.

How To:

Step 1: Launch Advanced Find

Step 2: When Advanced Find Dialog opens, change the “Look for” Combo box to be “Views”

Step 3: Change the Select Option to “View”, “Equals”

Step 4: Use the Lookup to find “All Members”. NOTE: You will see 3 “All Members” listed in your Lookup window, each one represents an Account, Contact, or Lead “All Members View”. For this example select all three. Optional, you can save your view query for future use.

clip_image004
Fig 2: Advanced Find Dialog

Step 5: Click Find on the Advanced Find Dialog and you should now have a results page listing three “All Members” Views, representing the “All Members” view for an Account, Contact, and Lead. Double Click on Each View to open.

Step 6: When each View is Opened, Select the “Add Columns” button and a property list will appear. Choose a property from the list you want to have displayed as a column by check enabling the box next to the property, in this example I will be choosing the property “E-mail”. Exit the property dialog by clicking ‘OK’ after making your selection.

clip_image006
Fig 4: All Members View for Account after adding the E-mail Column

Step 7: You are free to make other modifications to this View as well, such as column and sort order. Make your changes, Select “Save and Close”, and repeat (if desired) to the other “All Members” views returned by the Advanced Find Query.

Step 8: Important! Finally we need to publish these changes before they can become active. The saved view you modified will appear as an additional item (draft) until it is published and overwrites the existing View. Navigate in the system to ‘Settings’ -> ‘Customization’ -> ‘Customize Entities’. Under the menu Item “More Actions” Select “Publish All Customizations” or you can Use the “Publish” Button.

Important Note: Use the “Publish” button To ONLY publish the highlighted Entity row from the Grid (for example if you customized the memberlist view for Contacts, then select the ‘Contact’ entity item in the grid before pressing Publish. If Using “Publish All Customizations”, be aware that every customization pending in the system will be published!

clip_image008

Result: The List Member View has been modified…

clip_image010
Fig 5: Modified List Member View

Cheers,

Jim Schumacher

Changing the Domain and/or Username in CRM 4.0

09:00 12/16/2008, Luke Simpson wrote this

Microsoft has changed the way administrators may alter an existing user's Domain and/or Username in CRM 4.0.  A knowledge base article exists with detailed instructions, which can be found here: http://support.microsoft.com/kb/930853.

 Here is a quick synopsis of the procedure:

  1. Modify the user account in Active Directory. For example, change the user name, and then change the logon name.
  2. Open Microsoft Dynamics CRM 4.0 as a System Administrator user.
  3. Click Settings, click Administration, click Users, and then open the user record that you want to change.
  4. In the Domain Logon Name box, type an Active Directory user account that is not used by a Microsoft Dynamics CRM 4.0 user record.
    ~~This should just be any AD user on the network that is not using CRM.  It is just a placeholder.

    Note If all the Active Directory user accounts are used by Microsoft Dynamics CRM 4.0 user records, create a temporary Active Directory user account.
  5. Click Save.
  6. In the Domain Logon Name box, type the Active Directory user account. Then, click Save and Close.  
    ~~This should be the new Username that you wish to use.

    Note The Active Directory user account that you type in this step is the account that is used by a Microsoft Dynamics CRM 4.0 user record. The Microsoft Dynamics CRM 4.0 user record is the record for which you want to change the user name and the logon name in Microsoft Dynamics CRM 4.0.

Microsoft BizTalk CRM 4.0 Adapter

posted at: 9:46 AM by Chris Scott

Microsoft recently released the BizTalk adapter for Microsoft Dynamics CRM 4.0. I have been working with the new adapter on a recent project and have found a few key items that are good to be aware of:

 

Number and size of new Schemas - The new adapter uses the 2007 endpoint which is much richer in functionality and includes some of the core features needed to support full integrations including the many-to-many relationships. At the price of this functionality though is many new schemas for a total of 8 per entity (the previous adapter had 3)

  • [EntityName]_CoreTypes.xsd – defines various security related data types and methods. Includes references to [EntityName]_types.xsd.
  • [EntityName]_CoreTypes_1.xsd – defines various platform level methods. Includes references to [EntityName]_types.xsd and [EntityName]_webservices.xsd.
  • [EntityName]_Query.xsd – defines many of the items needed for query expressions and fetch statements.
  • [EntityName]_Scheduling.xsd – defines various appointment requests. Includes references to [EntityName]_types.xsd and [EntityName]_webservices.xsd.
  • [EntityName]_Types.xsd – defines the GUID data type.
  • [EntityName]_WebServices.xsd – defines the business entity and several of the CRM data types. Includes references to [EntityName]_types.xsd.
  • [EntityName]_WebServices_1.xsd – essentially is the WSDL output. Includes references to all schemas above.
  • [EntityName]_Entities.xsd – defines the attributes on the entity and used to map all messages to CRM. Includes references to all schemas above.

The schemas range in size from 1 kilobyte to over a megabyte (depending on the size of the entity). For integrations dealing with more than a couple of entities, the size and number of schemas will likely be a problem.

Our solution includes over 30 entities. During the compiling of our BTS solution with the new schemas, the following error was thrown by Visual Studio:

Unexpected error writing metadata to file 'c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\BizTalk Server Project1\obj\Development\~BizTalk Server Project1.dll' -- ''

The result of our testing showed that the new schemas caused the DLL size to be too large as Visual Studio tried to compile the project (documented in MSDN). We tried breaking the solution into multiple projects, but we still ran into this problem. Our solution was to create a “common” set of schemas from the 7 generated and update the [EntityName]_Entities.xsd to reference the common schemas rather than the entity specific schemas. This is a fairly simple solution and we have not found any issues in testing, but it does require updating the CRM schemas each time you download or update a CRM entity.

CRM Response Namespace - A core feature of the new adapter and of CRM 4.0 is supporting multiple organizations. While this is a really cool feature, we have found an issue with the new adapter that make truly supporting multiple organizations in BizTalk very challenging. The CRM response XSD, a generic XSD containing the success or failure message sent from CRM on each call, has an organization specific namespace. For example, in Ascentium’s development environment (organization is AscentiumCrmDev) has a CRM response XSD namespace of http://schemas.microsoft.com/crm/2007/BizTalkAdapter/AscentiumCRMDev/Response. The problem with this is that if the organization name changes from what the BizTalk solution was developed on, the response message will fail because of the differences in expected namespace.

Here are a couple of possible solutions that we considered:

    • Creating a custom receive pipeline to change the namespace.
    • Create multiple inbound schema and maps for known organizations and map your ports to the appropriate maps.
    • Ignore the response message from CRM.

There are many more possible solutions including keeping the organization names the same between all environments, but this defeats the purpose of supporting multiple organizations. For our solution, we implemented a custom receive pipeline to update the namespace as the message comes back from CRM. This is not a simple solution and requires a decent amount of coding, but it serves the long term need for our project.

Empy DateTime Data Types Messages bound to a CRM schema with data type of CrmDateTime containing an empty string receive this error:

CrmSoapExtension detected CrmException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Microsoft.Crm.CrmArgumentNullException: serializedForm ---> System.ArgumentNullException: Value cannot be null. Parameter name: serializedForm

To get around this, we updated our maps to include a logical string functoid on date time data types. This removed the node from the message sent to CRM if the value passed in is empty.

 

Overall, I have been pleased with the updated CRM adapter for BizTalk. It offers a lot of rich functionality and is a welcome tool for CRM 4.0 integrations. Just be aware of the above issues when you start working with the new adapter.

 

Chris

This posting is provided "AS IS" with no warranties, and confers no rights.

The List Web Part for Microsoft Dynamics CRM 4.0

The List Web Part for Microsoft Dynamics CRM 4.0
Overview
The List Web Part for Microsoft Dynamics CRM 4.0 provides a way to view and update Microsoft Dynamics CRM records using a Windows SharePoint Services 3.0 SP1 or Microsoft Office SharePoint Server 2007 SP1 Web site. Microsoft Dynamics CRM users can create shared or personal List Web Parts of Microsoft Dynamics CRM records from a SharePoint Web site, open records in Microsoft Dynamics CRM 4.0 from the List Web Part, and create connected List Web Parts.

System Requirements

  • Supported Operating Systems: Windows Server 2003; Windows Server 2008
    Microsoft Dynamics® CRM 4.0
  • Microsoft Windows® SharePoint® Services 3.0 SP1
  • Microsoft® Office SharePoint® Server (MOSS) 2007 SP1
  • Microsoft® Internet Explorer 6 with SP1 or later versions

Instructions

You must have local administrator privileges on the server where you plan to install the List Web Part for Microsoft Dynamics CRM 4.0. You must also have administrator privileges for the SharePoint Services server. The List Web Part for Microsoft Dynamics CRM 4.0 must run by using full trust mode.Click the ListWebPart.msi file to run the List Web Part for Microsoft Dynamics CRM 4.0 Setup wizard. If you are using Windows Server 2008, install the List Web Part by using the command prompt instructions found in the documentation.

For more information, see the documentation: List Web Part for Microsoft Dynamics CRM 4.0 Administration and Deployment Guide.

An early look at CRM “5”

Microsoft Dynamics CRM Team Blog posted this

As you might imagine, since shipping Dynamics CRM 4 the product team has been hard at work designing the next major release.  Over the past few months they’ve given a few sneak peeks at some of the more interesting platform pieces that they’re working on.  Naturally I grabbed my video camera and got as much as I could.  That’s all posted up on Channel 9 now.  We also had a couple of excellent CRM “5” sessions at this year’s Professional Developers Conference (PDC).  Those also are available for viewing.  I’ve pulled together this list of videos for those of you that need a break from the holiday festivities. :)

Overview

In this first video I chat with Andy Bybee, Humberto Lezama Guadarrama and Allen Hafezipour all program managers on the CRM platform team thinking about programmability and the developer experience.  We talked about some of the thinking that’s going into CRM “5” (that’s a codename, by the way).  Don’t look for any schedule information in here; CRM “5” is still a long way away.  We’re talking about this developer-focused stuff early to help developers with design and architecture as they think about future designs.  The team is still committed to power of choice and so will continue to use the exact same code base across on-premises, partner-hosted and Dynamics CRM Online. 

  • Have a look at the video here.

Solution Management

One area that the platform team is spending a lot of time thinking about is solution management.  We know that ISVs have numerous things to think about when deploying and we want to make that as simple as possible by introducing the concept of solutions.  Think of solutions as providing to CRM the same sort of capabilities that Windows has with its capability to add and remove programs and features.  The concept is quite powerful as it allows components to be layered on to the base system but also on top of other solutions (i.e. when there are inter-dependencies).  It also provides a way to protect the intellectual property of the components in your solution and includes change management and versioning.

  • Have a look at the video here.

 Secure Code on the Server

Another area that the team is working hard to make even better is the deployment of secure code on the server.  The current version of CRM allows code on the server (for plug-ins or workflows) and that code runs in full trust.  That’s the primary reason why server code is not allowed on Dynamics CRM Online where you’re sharing the server with many other tenants.  There are a number of different areas where you might need to write custom code on the server; for instance, custom workflows, custom web apps, plug-ins.  It’s not hard to allow that sort of thing.  Where it gets tricky is allowing developers to do that in ways that don’t compromise security and performance.  The team has been thinking hard about what is needed to solve these types of problems (profiling, tracing, and managing security of numerous managed assemblies).  They looked at physical (sandboxing) and logical (code access security) isolation levels and have come up with a plan.

  • Have a look at the video here.

PDC: Dynamics CRM: The Appealing Business Application

Humberto Lezama Guadarrama presented this session.  He walked through an introduction to building line-of-business applications on the CRM platform.  I helped him out with a demo my team has been working on (starting at about the 23:00 mark).  Humberto talks about leveraging Dynamics CRM in the context of cloud services including Windows Azure (starting at about 36:30).  He also shows some of the new stuff coming in CRM “5” (starting at about 45:30).

Abstract: Have you ever built a business application that people actually enjoy using? Learn how you can build appealing business applications using the Microsoft Dynamics CRM product and its application constructs, including the client-side compositing framework, page layout, and forms. See how Dynamics CRM adds value as a rapid application development solution with integration into cloud platform services

  • Have a look at the video here.

PDC: Rapid Business Application Development with Dynamics CRM

Andrew Bybee and Nirav Shah presented this 400-level session.  In it they show how Dynamics CRM can be used for rapid development of business applications.  In it they show some of the new capabilities for extending business logic in Dynamics CRM “5” (starting at about 16:00).  They focus primarily on the platform so not so much on the sales, service, and marketing applications but more on the underlying platform or what we often call xRM.  They pulled in Shan McArthur from ADXSTUDIO to demonstrate a new solution that his team has been working on (starting at about 43:30). BTW, on my blog I have another video with Shan explaining what he learned while building this Windows Azure/Dynamics CRM app.

Abstract: Learn how the next version of the Microsoft Dynamics CRM data model can be manipulated through meta data. See how to add custom business logic, including plug-ins and custom messages for Microsoft Dynamics CRM entities. 

  • Have a look at the video here.
Technorati Tags: ,

Cheers,

Ben Riga