Dynamics CRM, Mobility and other stuff

vrijdag, juli 10, 2009

Adding "Next/Previous" buttons to Entity Details Form Revisited...Again

Ok, I've been rather busy the last, eh, year. But today I got another comment on one of my most popular posts, Adding "Next/Previous" buttons to Entity Details Form Revisited.

Jeremy Winchell explained how he made this customization work for Dynamics CRM 4.0. So I thought I'd update the download to support CRM 4.0.

To make this work you have to export the ISV Config Customization from CRM. Then copy the <Entity>...</Entity> contents from the isv.config.xml file and put it between the <configuration><Entities> elements in the exported ISV Config file. Then upload the file again and voila, you have your next/previous buttons in CRM 4.0!

Thanks Jeremy!

Download the CRM 4.0 version here.

Download the CRM 3.0 version here.

Labels: ,

donderdag, april 03, 2008

New CWR Mobile CRM license types and pricing

With the introduction of CWR Mobile CRM 4.0 we've introduced a new licensing model and new pricing.

Next to the already existing on-premise version, we've added Partner hosted and CWR hosted. CWR hosted basically means that we host the Mobile Server for you and we connect to your CRM environment or your CRM Online (formerly Live) organization.

Furthermore, instead of one version-one price we now have a Standard and a Professional version with different prices. In short, the difference is that the Standard version has all the capabilities of the Professional, except for the SDK. So you cannot extend the mobile client with client-side callouts and custom controls in the Standard version.

When you don't need the advanced stuff like signature capturing, barcode scanning, route navigation etc. then the Standard version will be an attractively priced option for your organization.

The new Standard and Professional license types are available for the existing CWR Mobile CRM 1.2 (for CRM 3.0) and the new CWR Mobile CRM 4.0 release.

See here for the different versions and pricing details.

Labels: , ,

woensdag, maart 05, 2008

CWR Mobile CRM 4.0 launched at the Convergence in Orlando

CWR Mobility will launch their new CWR Mobile CRM 4.0 product at the Convergence 2008 in Orlando, Florida.

CWR Mobile CRM is a rich PDA client for Dynamics CRM 4.0 running on Windows Mobile powered devices.

"We are really excited about this new release." says Erik van Hoof, CEO of CWR Mobility BV, "We have implemented the major features of CRM 4.0 in our new release to enable full support of the powerful customization options. We have added the multi-lingual screens, multi-currency and the possibility to install the mobile application on a multi-tenant partner hosted environment."

"Another exciting new feature is the integration into Pocket Outlook. You can now access CRM directly from your Outlook Contacts, Appointments and Tasks." added Erik van Hoof.

The full version will be available for download at the end of March by Partners of CWR Mobility BV.

More information can be found at: www.cwrmobility.com -> products -> CWR Mobile CRM

Labels: , , ,

vrijdag, januari 18, 2008

CRM Error Message of the Day: 0x80040237

It's been a while since my last "error message of the day" post, but here's another one.

The description for this error is: DuplicateRecord: Operation failed due to a SQL integrity violation. However, the DuplicateRecord part is a bit misleading. The actual problem can be a variety of things. Just do a search for 0x80040237 and you'll find a lot of different situations.

I came across this error when working on an Experlogix project for a client. Experlogix has a great Product Configurator tool for CRM. You can read more about that here.

Anyway, IT operations had just implemented sql replication based on the excellent whitepaper by Sonoma Partners. This whitepaper describes how to increase performance by putting the reports on a dedicated sql server. To do this you need to replicate the CRM data to the dedicated report server.

After replication was in place we received errors when trying to create a configuration in Experlogix. A configuration is a quote with quotedetails.

The log files showed this:
w3wp-.log
0x80040e14
[2008-01-15 10:00:29.934] Process:w3wp Thread:3660 Category: Unmanaged.Platform User: PlatformUser Level: Error InternalCrmSetErrorInfo File: C:\bt\876\src\platform\include\Util\ICrmError.h Line: 362>Operation failed due to a SQL integrity violation.

w3wp-MSCRMServices-.log
Server was unable to process request. --> Exception has been thrown by the target of an invocation. --> Exception has been thrown by the target of an invocation. --> Exception from HRESULT: 0x80040237.DuplicateRecord 80040237 Operation failed due to a SQL integrity violation.

Error code 0x80040e14 is a general sql error and doesn't tell you much. Error code 80040237 is the CRM Operation failed due to a SQL integrity violation error.

So the trace files give little more information. Sql Profiler to the rescue!

We reproduced the error while we had Sql Profiler running. A few tips when using Sql Profiler:
  1. Filter on DatabaseId, especially when the sql server runs multiple databases, which is common.
  2. To get the database id run this statement in Query Analyzer: select db_id('organizationname_MSCRM'). This will return a number that you can use to filter on. This will limit the amount of data returned by the profiler.
  3. Limit the number of events you want to see. I usually want to see some Stored Procedures and TSQL events and I'm not interested in Security Audits and Sessions events (these are enabled by default).

In the first trace I noticed the following statement: IF @@TRANCOUNT > 0 ROLLBACK TRAN
Normally you should see: IF @@TRANCOUNT > 0 COMMIT TRAN

So everything went fine up until the last update of the quote header, after which it rolled back.

I added some extra events from the "Errors and Warnings" category. And after doing a new trace the Exception event showed this: Error: 7139, Severity: 16, State: 1

Ok, now we're getting somewhere!

Doing a quick search shows this: "SQL server error 7139: Length of text, ntext, or image data (834122) to be replicated exceeds configured maximum of 65536."

So what was wrong? Experlogix uses a custom attribute (exp_config) to store the configuration of the quote. This is an ntext field in sql and can become quite large, depending on the complexity of the configuration.

Now you're saying, I'm not using Experlogix so I won't run into this problem, right? Wrong! This can also happen when using attachments. An attachment is also stored in an ntext field and can get pretty big.

So, what's the solution? Luckily it's easy. You can use sp_configure to change the value for max text repl size. The default value is 65536 but you can increase this up to 2.147.483.647.

Execute this statement in query analyzer:
sp_configure 'max text repl size', 1000000
reconfigure

This will increase the size from 65536 to 1000000. Obviously you can change this value according to your needs. Given that an attachment can be up to 4 MB you might want to set it to 5000000 for example. That way you're safe.

Disclaimer: These findings are based on CRM 3.0, but I assume it also applies to CRM 4.0.

Labels: , ,

vrijdag, december 14, 2007

Adding "Next/Previous" buttons to Entity Details Form Revisited

It's funny to get a lot of reactions lately on a post (from almost two years ago!), Adding "Next/Previous" buttons to Entity Details Form. Maybe it has to do with this post from Philip Richardson, I don't know :).

Anyway, thanks to some feedback from Matt Wittemann and Jim Steger I've made some small updates. One is an addition to support custom entities (thanks Matt) and one is a bugfix, it gave an error when using the buttons on a form that is not opened from a grid (thanks Jim).

I've updated the sample code in the zip file with these additions.

Another comment from Bart Vierbergen about an enhanced for CRM 4.0 (using the entitytypename instead of entitytypecode) I leave as a simple exercise for the reader :).

Download the new version here.

Labels: ,

vrijdag, november 02, 2007

CRM Live and OpenSocial?

If you haven't been living under a rock the past week you've probably heard of the new Google initiative OpenSocial. OpenSocial is not a new social network, it is a set of common APIs that application developers can use to create applications that work on any social networks (called “hosts”) that choose to participate.

Application builders can build their apps using the OpenSocial API and they can run on any site that support this API. Don't be fooled though that this only applies to social networks. Besides the obvious "social network" participants like Orkut, LinkedIn, Ning, Hi5, Plaxo, Friendster, Viadeo, there's also Salesforce.com and Oracle joining.

Microsoft watcher Mary Jo Foley asks: Should Microsoft join or fight the OpenSocial?

I can imagine Microsoft isn't very keen on joining this Google regulated initiative. However, it would be nice to add some "social networking" apps to CRM Live, that would e.g. integrate with the professional network site LinkedIn or Plaxo.

So what do you think, should Microsoft join?

Update: Humberto from the Dynamics CRM team questions the value of social networks.

Labels: , ,

donderdag, oktober 25, 2007

Convergence 2007 Copenhagen is over!

Wow, what an event! Convergence Copenhagen is over. Three days packed with sessions, demo's, partner exhibitions etc. It has been an intense event, but very rewarding.

Erik did 3 sessions on Mobility and Dynamics CRM. Two from the Windows Mobile point of view together with Mark Grady from the Windows Mobile team and one from the Dynamics CRM point of view together with Barry Givens from the Dynamics CRM team. In both sessions he was able to showcase the power of using CWR Mobile CRM together with Dynamics CRM to build a great mobile CRM solution.

All sessions were fully booked and in one session people even needed to stand in the back because there were no more seats available!

We also had a booth at the partner exhibition and in addition to that we were "guest host" at the Windows Mobile booth for a few hours a day. The Windows Mobile booth featured an HTC mobile device as large as a 19 inch monitor (actually a monitor in a HTC skin...), so it was great to demo the mobile solution on it. We have to try to get one of those for some other events :).

It was nice to meet with customers and partners, some CRM MVP's (Ronald Lemmen and Michael Hoehne) and people from the Microsoft teams.

We were also invited to the Windows Mobile partner dinner. We met a lot of interesting people there. After dinner the party continued at some bars. Some people made it later than others. I heared about a few people who went to bed when the sun was already rising :). No, it was not me, I had booth duty the next day...

We're just about finished packing the stand equipment and get some relaxation. We'll fly home tomorrow afternoon, so we will have some time to go and see the famous Copenhagen mermaid before we leave :).

That's it, catch us at the next Convergence next year in Orlando!

Labels: , ,

maandag, oktober 01, 2007

First look at CRM "Titan"

It's October 1st so the Titan NDA has been officially dropped. Not surprisingly CRM MVP Michael Höhne is the first one (that I know of) to blog about it. He gives a nice introductory overview of Titan with lots of screenshots :).

Expect more to come...

Labels: , ,

Sonoma mobility webinar ft. CWR Mobile CRM

Mike Snyder from Sonoma Partners just blogged about their mobility webinar in which they presented several CRM mobility solutions. The verdict?
If you want to use CRM data extensively (logging calls, adding notes, etc.) on
your mobile device: Buy CWR Mobile if you have a Windows device.

You can read the full post here. And view the recorded webinar here.

Disclaimer: we did not sponsor this webinar ;)

UPDATE:
Just a little update after reviewing the webinar.

1.
One of the 'cons' of our application is that you need to cradle the device to install the software. Technically this is not correct. You can install the software over-the-air (OTA) just fine. However, the software is about 2 MB so downloading it may take a while over a slow connection. You should be fine though when using something like UMTS.

2.
Another 'con' is that there's no out-of-the-box activity tracking of emails and phonecalls. E.g. that when you call someone, a phonecall is automatically created and prefilled for you. It is true that this functionality doesn't exist out-of-the-box. Erik shows in this blog post how easy it is to build this functionality using our SDK. So if you buy the product and you need this functionality, it's already there!

I hope that's a little les 'con' :).

Labels: , ,

zaterdag, september 29, 2007

Video: Automatically create a phonecall activity when making a phonecall

The second video on how to work with CWR Mobile CRM will demonstrate the possibility to automatically create a phonecall when dialing a phone number from within a record.

The functionality that is being demonstrated is based on our custom control extension model.

The 'phonecall' control will dial the phonenumber and open a new phonecall record, automatically filled with the sender and the receiver, the phonenumber and the duration of the call.

Whatch the video on Soapbox:


Video: Create phonecall on CWR Mobile CRM

Labels: , , , ,

Free license for Microsoft Dynamics CRM MVP's (Most Valuable Professionals)

Being a Microsoft Dynamics CRM MVP is already an accomplishment and an honor, but now it even got better!

We all know how much time and effort MVP's dedicate to the CRM community; sharing their knowledge in newsgroups, user groups and in many other ways. As a token of our appreciation to the community of MVP's CWR Mobility offers a free CWR Mobile CRM license to any Microsoft Dynamics CRM MVP!

How to request a license?
To request your license please send an e-mail to support@cwrmobility.com and include your name, e-mail and a proof of your MVP status. We will then contact you to setup your free license.

UPDATE: Go here to request a free MVP license.

How do I know if I qualify for a free license?
If you're a Dynamics CRM MVP then you probably know you're one :). But in case you're not sure, take a look at https://mvp.support.microsoft.com/communities/mvp.aspx?product=1&competency=Microsoft+Dynamics+CRM to see a list of Dynamics CRM MVP's.

Just our way to say thanks to all Dynamics CRM MVP's.

Labels: , , ,

dinsdag, september 11, 2007

CWR Mobile CRM 1.2 released!

After months of hard work we are pleased to announce version 1.2 of our CWR Mobile CRM application!

Some highlights of this version:


Graphical sitemap configurator

This means, no more xml editing your sitemap, just click or drag 'n drop. Heck, Dynamics CRM doesn't even have that! ;)



Graphical filter configurator

Create your synchronization filters using a fully graphical filter editor!


Choose your Lookup entities
For Lookup fields you can choose which entities you want to show in the lookup window and in what order! Take for example this Regarding field:

Yeah, we think it's cool too :)


Highly improved synchronization

Limites bandwidth usage and improves synchronization time by 400%. Yes, we listen to your feedback :).


Real Windows Mobile experience

Context sensitive menus, keyboard navigation.

The most common action is located at the left menu, other actions are located in the right menu.

Since pictures say more than a thousand words, here's some pictures...
Using the left/right and up/down buttons you can quickly navigate through the menu groups and menu items.

Convenient access to related entities using the right menu.

Easy switching between views using the right Views menu.

Switching between Agenda, Day, Week and Month view using the Left menu.

Webinars
We will be scheduling some webinars that will showcase our CWR Mobile CRM application. More information coming soon!

Labels: , ,

vrijdag, juli 20, 2007

CRM Lesson Learned: be careful what you update...

So, I thought it would be nice to start a new series, "Lessons Learned". Well, I'm not sure it's gonna be more than one post, but it sounds nice right? :)

Anyway, todays lesson learned is "be careful what you update". I was recently working on a callout for recurring appointments, a much requested feature for MS CRM. In short, when an appointment was completed a new appointment was created based on some settings in the regarding account record. The regarding account record was then updated with last visit date.

However, on testing this callout I found out that every time the appointment was closed and a new one was created (through the callout), the owner of the two appointments changed. It was set to the owner of the regarding account record.

Now, the account entity has a parental relationship with the appointment entity. This means that e.g. a share or assign of the parent account is cascaded to the underlying appointment. That would explain the owner change of the appointments.

But I didn't do any assign or anything that would trigger the cascading rules, I only updated a custom datetime field, or so I thought...

I searched through my code to see if I assigned anything to the ownerid of the account record, but there was nothing. Finally, after some fruitless attempts I went to every line of my code to see what could be wrong and then it struck me. I retrieved the parent account and the columnset contained the accountid, cwr_lastvisitdate and the ownerid! I needed the ownerid for a check.

After I retrieved the account I only updated the cwr_lastvisitdate field and then I called crmservice.Update() on it.

However, when you call Update on an entity it updates all the fields contained in the entity. And the entity also contained the ownerid! And apparently, because the ownerid was updated (even though it was not changed!), MS CRM interpreted it as an Assign. The rest is history. The assign triggered the cascading rules and the owner of all underlying records was changed to the owner of the account.

So the lesson learned: be very careful about which columns you retrieve when you want to update the retrieved entity. You might get some unexpected results :)

Happy coding and stay mobile!

Labels: ,

maandag, juni 04, 2007

Mobile CRM on Smartphone

As we are approaching the release of our new version 1.2 I want to show you one of the biggest new features:


Smartphone
The new version will be working on a Smartphone and Windows Mobile 6 Standard device.
The biggest change to accomplish that was to fully implement key navigation.
This had a big impact on how the application behaves and navigates.


Screenshots


Information
If you are interested in learning more about our software, please visit http://www.cwrmobility.com


Labels: , ,

vrijdag, mei 18, 2007

CRM Productivity booster

Saw this link on Ben Vollmer's blog. The guys from AdvantageWorks have created an inline editable grid. Looks really nice and together with their SplitView component it looks like a real productivity booster! You save a few clicks and have to open less popup windows, which makes your users happy :).

Labels:

zondag, mei 13, 2007

CRM App Dev session at MIX07

I just ran across a post from Ben Riga where he talks about a session he did together with Jason Hunt of Invoke Systems at MIX07 about:
How ISV's can use the Dynamics CRM platform to build all sorts of wild and
wonderful line-of-business apps.

It looks like it's becoming a trend to talk about Dynamics CRM as an application development platform instead of just a CRM app and I like it. The reality already is, I haven't seen a single customer that uses Dynamics CRM without any custom entities.

The session is pretty cool, really shows the strengths of CRM. You can view it here. Cool detail: it's available in Silverlight!

Now, wouldn't it be nice to do a demo/workshop on using Dynamics CRM as a (mobile) application development platform? I'm just thinking out loud here, but it sure would be cool to do a showcase on how to build a custom app from scratch using Dynamics CRM and then mobilizing that app using CWR Mobile CRM in a matter of hours! (disclaimer: obviously, building a complete app including business analysis, design, etc. etc. would take much longer, but I hope you get the point...).

Anyway Ben, if you're interested, let me know! WWPC anyone? ;)

Labels: , ,

donderdag, mei 10, 2007

CRM Error Message of the Day: 0x80131500

Ok it's been a while, but here's another CRM Error Message of the Day.

This time it's related to the Bulk Import Wizard. I was trying to import some contacts from a .csv file I got from a customer. Some of them imported successfully and other failed. The reason was "Error" and the reasonid 0x80131500.

Searching for this number on Google didn't return any relevant hits. I did find this article: Save time when you import leads, contacts, and accounts. Going through all the recommendations I ended up here, Importing dates. I quote:

"Dates must be in the format specified in Microsoft Dynamics CRM on the Calendar
tab of the System Settings page."


I did have a date field in my .csv file, so I started investigating. The date format in the System Settings was set to MM/dd/yyyy. However, when I tried to import a record with a date in this format it failed with 0x80131500. Note: this was a date like 12/23/2000. So 23 for a day would be fine, but 23 for a month would obviously fail.

When I changed the date in the import file to 23/12/2000, i.e. dd/MM/yyyy it went fine! Strangely enough, when I opened the just imported contact, the date I just imported was shown in the dd/MM/yyyy format, despite the fact that the date format in the system settings was MM/dd/yyyy.

I tested the same behavior on another CRM system with a different date format, but exactly the same happened. In other words, using the date format from the System Settings as described in the abovementioned article doesn't work!

Ofcourse, a colleague of mine told me to always use the yyyy/MM/dd date format, that always works and indeed, it did work. :)

Labels: ,

vrijdag, april 27, 2007

MEDC 2007: ETA tomorrow night!

Ok, we're almost there. Tomorrow night I will be in Las Vegas! I know, it's a little early for MEDC, which start May 1st. But that gives me the time to do some sightseeing and prepare for my presentation :)

My presentation is on the first day of the conference, so after that I'll have plenty of time to attend other sessions and learn new things about windows mobile development and especially the new Windows Mobile 6! Things I will put to good use for the next versions of our CWR Mobile CRM application of course! :)

It will also be my first trip to the US, so I'm pretty excited about that. The only thing that worries me a bit is the 15,5 hour journey, but we'll see how that goes.

I'll try to keep you posted on interesting things at MEDC!

Labels: ,

dinsdag, april 17, 2007

Presenting at MEDC 2007

In about 3 weeks MEDC 2007 (Mobile and Embedded Developer's Conference) kicks off in Las Vegas. It runs from April 30 to May 3 and features more than 130 technical sessions and labs in the area of mobile and embedded development and solutions.

I will be presenting a session together with Michael Rich from Microsoft. The session will be on integrating CRM and ERP systems and extending it to the mobile field force. Michael Rich will focus on the CRM/ERP integration and I will focus on how to make the information mobile using our CWR Mobile CRM solution. Here the session description:

Integrating Customer Relationship Management (CRM) and Enterprise Resource Planning (ERP) Systems
Speaker(s): Michael Rich, Jeffry van de Vuurst
Most companies have some CRM/ERP packages running in their business. Those systems become even more powerful when you can extend this information to their sales field, customer service field, and other mobile workers. This session will cover hands-on ways to jumpstart projects integrating Windows Mobile with Microsoft Dynamics CRM. With Microsoft CRMs Enterprise Connectivity that can provide mobile access to data from other Dynamics products, SAP, Siebel, etc.

So, you can guess I'm pretty excited about presenting at MEDC 2007 and in Las Vegas of all places!

I know CRM folks are not the primary target audience for MEDC 2007, but still, if you happen to visit drop me a line!

Labels: , ,

vrijdag, april 06, 2007

Just released: CWR Mobile CRM 1.1!

CWR Mobility is pleased to announce version 1.1 of our CWR Mobile CRM application!

This version contains lots of new features and improvements. Some of the highlights are:
  • Uploading and downloading of attachments on the mobile client. This opens up lots of new possibilities for your field work force. Imagine you're an insurance agent and you're on location inspecting a damaged car. Just take a picture (your pda has a camera right?), attach it to a case and the office has all the information within minutes! And did I mention signature captures? With the ability to create custom controls and client-side callouts, the possibilities are endless!
  • A feature rich calendar control with a timetable, day, week, month and even a resource view! From this calendar you can view and manage your appointments and serviceappointments.
  • Fully graphical mobile form and view editors in the Mobile Configurator. Why should creating mobile forms and views be harder than creating CRM forms and views? Here are some screenshots.
This is the main screen where you can choose your options.


This should look familiar. Create tabs, add fields to the form, move them around. When you create a new form you can even choose to let the application generate a form for you based on the CRM form! Tell me that isn't cool :)


Double click a field and you can edit the field properties.

What about creating views? Ofcourse you can generate them, just as with forms. You can add several views and related views (associated views in CRM). You can add filter fields and change the view properties (whether you are able to delete records from a view, or create new records).

And here's a nice example how to edit the filter criteria for a view:


We've also added the ability to import and export not only individual forms and views, but also a complete profile. This makes it easy for us to create a default "vertical" profile that you can then import into your system. It also makes it easy to copy an existing form from one profile to another.

Profiles are not a new feature, they already existed in the first release. But I would like to elaborate a bit on profiles. A profile contains a selection of mobile entities with their own sync filters, views and forms. This is a very powerful feature. E.g. it enables you to have a Sales and a Service profile, each with their own mobile entities. Each profile has its own sync filters so the Sales profile could sync "all active accounts" while the Service profile could sync "all accounts with active cases".

Also forms and views are defined per profile. You could make the Account form readonly for the Service profile (they don't need to edit account info) and editable for the Sales profile (they manage account info). You can even define field level security using profiles!

So, watch this blog and our website for more information, soon to come!

Labels: ,

dinsdag, april 03, 2007

Dynamics CRM video on Channel 9

I visit Channel 9 regularly to see if there are new interesting video's and today I saw an interview with Brad Wilson, Bill Patterson and Ben Riga about Dynamics CRM.

They're talking about Dynamics CRM as a platform for building all sorts of applications, not just CRM. Hey, where did we hear that before? :)

I'm curious to see what the future brings for CRM as a development platform. Go see the video, it's interesting.

So what does that mean for our CWR Mobile CRM application? It means we can mobilize just about everything! As long as you can define it in MS CRM, you can make it mobile. We might need to change the name from CWR Mobile CRM to CWR Mobile Application Platform though :).

Labels: , ,

zaterdag, maart 03, 2007

Where is the DownloadAttachment message?

So we have the UploadFromBase64DataAnnotation message to upload an attachment to an annotation. And we have RemoveBinaryDataAnnotation to remove an attachment from an annotation.

Then where is the message to retrieve an attachment from an annotation (or an ActivityMimeAttachment, or a SalesLiteratureItem)? I would expect there to be a DownloadAttachment or DownloadBinaryDataAnnotation or whatever you call it message, but there isn't!

The SDK provides an example to programmatically download an attachment:
string attachid = "{61BB601D-C43F-4738-BD1F-AD22DC8E7F0E}";
string objecttypecode = "1070"; //SaleLiteratureItem
string url = "http://mycrm/Activities/Attachment/download.aspx?AttachmentType=" + objecttypecode + "&AttachmentId=" + attachid;
System.Net.WebClient myWebClient = new System.Net.WebClient();
myWebClient.Credentials = System.Net.CredentialCache.DefaultCredentials;
myWebClient.DownloadFile(url,"C:\\myfile.txt");

There we have a nice webservice API to talk to MS CRM, the CrmService and MetadataService webservices. But then to download an attachment I have to this? Please add this message in the next version? Thanks! :)

BTW, I really like MS CRM, the extensibility, programmability and customization possibilities of it, don't get me wrong. I mean, it earns me a living :). But once in a while, you find something strange, or miss something that should be in there (you think) and you just to have rant a bit...Have a nice weekend!

Labels: ,

woensdag, februari 28, 2007

Generic sql error - SQL Timeouts

We are having some troubles with a specific CRM installation lately. For our Mobile CRM application we use FetchXml filters to determine which records to sync and some of those queries consistently result in a Sql timeout.

We did some extensive sql profiling and indeed, the problem queries take 30 seconds to execute and then they timeout. Strange part is that when executing the exact same queries in the Query Analyzer, they execute 50-100 times faster! This difference is shown in the Sql Profiler, so it is purely a Sql thing and has nothing to do with the fact that there are more layers in between when the query is executed using CRM.

Also, we are not talking about a database with hundreds of thousands of records, we're talking about thousands. We are also talking about a rather large query with several joins between e.g. annotations, accounts, activitypointers and activityparties. Not a really simple query, but also not extremely complex.

We also did some database tuning and implemented some recommendations, like new indexes and statistics. This did help for the queries that were already executing fine, they were even faster, but this didn't help for the problem queries.

Some google-ing shows that more people have noticed the extreme difference in performance between executing queries using ADO.NET and directly in the Query Analyzer. Unfortunately, I haven't seen any good explanations or answers yet. Some people talk about different SET options which may affect the query execution plan. Other people found workarounds by changing the queries, etc. However, that's not an option because it's CRM that builds the queries so there's nothing we can do about that AFAIK.

I think the next step is to contact Microsoft support or the CRM team about this and see if they can come up with a solution. In the meantime, if anyone has any bright ideas, please comment :).

Labels: , ,

dinsdag, december 27, 2005

Adding "Next/Previous" buttons to Entity Details Form

Update: I've updated the sample due to some feedback I received, read about it here! BTW, the download link at the bottom of this article also points to the updated sample!

Last week, I was looking through the history of a Contact in CRM, trying to locate a certain e-mail activity. So I opened the History tab and opened the first e-mail. Nope, not the one. Next.

After closing and opening 4 e-mails, I thought it would be nice to have some Previous/Next buttons, just like Outlook has when you open an e-mail. It's not very productive to keep opening and closing those popup windows.

So I came up with some javascript that does this for me. All you have to do is put this in your isv.config.xml:

< name="account">< validforcreate="0" validforupdate="1">< title="Previous" javascript="var _cwrRecordIndex; var _cwrGrid=window.opener.document.all['crmGrid'].InnerGrid; var _cwrRecords=_cwrGrid.AllRecords; for(var i=0; i<_cwrRecords.length; i++){if(_cwrRecords[i][0] == crmForm.ObjectId){if(i!=0){window.location.href=window.location.href.split('?')[0]+'?id='+_cwrRecords[i-1][0];_cwrGrid.UnselectRecords();_cwrGrid.SelectRecords(i-1,i-1,false);}}}" client="Web" icon="/_imgs/cwr_previous.gif">< title="Next" javascript="var _cwrRecordIndex; var _cwrGrid=window.opener.document.all['crmGrid'].InnerGrid; var _cwrRecords=_cwrGrid.AllRecords; for(var i=0; i<_cwrRecords.length; i++){if(_cwrRecords[i][0] == crmForm.ObjectId){if(i!=_cwrRecords.length-1){window.location.href=window.location.href.split('?')[0]+'?id='+_cwrRecords[i+1][0];_cwrGrid.UnselectRecords();_cwrGrid.SelectRecords(i+1,i+1,false);}}}" client="Web" icon="/_imgs/cwr_next.gif">

Note, it should go all on one line in your isv.config.xml. No line breaks.

Note 2: I put a space between the "<" and the element name, otherwise blogger thinks it's markup. I didn't really optimize the javascript code. Probably could be better, but this is the quick and dirty approach and I didn't feel like including a javascript file and then calling a function. All the code is inside the Javascript attribute. Also note that I use some undocumented javascript methods, so it's not supported! BTW, If you paid attention you would see that the code uses the entity "account". That's right. Unfortunately, CRM only permits you to customize the detail forms of certain entities, namely: account campaign campaignactivity campaignresponse incident (SDK wrongly calls this case) contact Custom entities invoice lead list opportunity salesorder quote You see? No activities! Anyway, for educational purposes I continue :). It does work for the other entities. So if you want to quickly browse through the invoices of an account, you can do that. Just add the two buttons to the invoice entity in your isv.config.xml. Here's a screenshot that shows browsing through accounts. Screenshot.

You can download a zip file which includes a sample isv.config.xml file and two images that you can put in the _imgs folder of your CRM webroot. Download it here.

Have fun!

Labels: ,