Monday, June 28, 2010

Stupid Error

I don't know why this keeps coming up, but it does.  Whatever AD service account you are using has to be a member of the "privusergroup" for that instance of CRM.  My test box suddenly stopped working last week, and it took me most of the day today to figure it out.  Frustrating...

http://blogs.msdn.com/b/jonasd/archive/2008/01/11/caller-does-not-have-enough-privilege-to-set-callerorigintoken-to-the-specified-value.aspx

Thursday, May 20, 2010

Where to find values for Picklist Items

When I finally get to reporting, I will need this more, but I also need this for some other data import work I am doing.

Just discovered how to get the actual picklist int value when you know the name.  You have to look in the StringMap table and link it to the MetadataSchema.Entity table (which I still can't find in the SSMS object browser, but it must be somewhere) on the ObjectTypeCode in each one.


SELECT s.*, ' ', e.*
FROM StringMap s
INNER JOIN MetadataSchema.Entity e ON s.ObjectTypeCode = e.ObjectTypeCode


Found it on this blog:
http://extremecrm.net/2009/03/22/display-a-crm-40-picklist-display-value-in-report-or-query/

Tuesday, May 4, 2010

Speed up your CRM SDK imports and updates

I ran across this problem several weeks ago that an import of many thousands of records using the CRM SDK was taking forever, or timing out.  Luckily, there is a setting on the connection object that you can use to speed things up quite a bit.


CrmService crm = new CrmService();
crm.Credentials = System.Net.CredentialCache.DefaultCredentials;

crm.UnsafeAuthenticatedConnectionSharing = true;

This other blog post describes these setting in more detail.

http://billoncrmtech.blogspot.com/2008/10/blog-move-speed-racer-call-crm-at.html

This was also discussed at a CRM Optimization session at Convergence 2010 and the Microsoft Support people said that for bulk inserts/updates this is OK to use, just keep in mind the caveats of only authenticating once.  Probably fine for internal use on your network, but not for external internet connections, etc.

Sunday, May 2, 2010

Color Coding your records

I've done this color coding with injected DHTML, but this other blog talks about using an IFRAME to do it.  I may have to take a look at this because I don't like the way mine gets resized.  I'm actually using color coding to show if a case is NEW, OPEN, or CLOSED, but I also use color in a field that has account and contact alerts in it.

http://businessnone.com/demo-tools/getting-customer-temperature/

Maybe an IFRAME works better?

Thursday, April 29, 2010

How to use External Javascript in your form

Just got back from the Convergence 2010 conference, and learned a LOT of great information on customizing Dynamics CRM.  One of this things I found very suprising was that the consulting services people said that it was OK to use external javascript files in your forms to make development easier.  I always thought this was unsupported in CRM, so I was happy to hear this.  
NOTE: If you have Outlook client users that take CRM offline, this method will not work.  You will need to come up with a way to get the external files onto their PC.  I have no idea how to do this, sorry.


Clicking Settings/Customization/Customize Entites/Case/Forms and Views/Form/Form Properties/OnLoad/Edit then pasting in the new code I just edited in VS2008.  Click Ok/Ok/Save and Close/Actions/Publish.  That's a lot of steps. :)

So when I got back to the office, I set to work externalizing the HUGE javascript files I had already created.  I found several other blog posts on how to do this, and frankly am a little frustrated that there are apparently several methods to do this, some of which don't work that well.

The big problem is caching in the browser.  A good idea when you want the browser to be fast, but a bad idea and a big pain when you are developing and constantly editing code, saving, and testing.

So here is the final code that I pasted into the OnLoad for my case form.

function load_script(url) {

   var url2 = url + "?dummy=" + Math.random().toString().substring(2);
   var x = new ActiveXObject("Msxml2.XMLHTTP");
   x.open('GET', url2, false);
   x.send('');
   eval(x.responseText);
   var s = x.responseText.split(/\n/);
   var r = /^function\s*([a-z_]+)/i;
   for (var i = 0; i < s.length; i++) {
     var m = r.exec(s[i]);
     if (m != null) {
        window[m[1]] = eval(m[1]);
     }
  }
}

load_script("/ISV/_scripts/CaseForm.js");

I won't pretend to know exactly what this script is doing, I just compiled it from a bunch of other sites and blogs.  The twist that I added was the editing of the URL to add the random math string.  Again, not my idea, just mashed it up from posts on these three sites.

http://www.henrycordes.nl
https://community.dynamics.com/blogs/crmmattwittemann
http://social.microsoft.com/Forums/en-US/crmdevelopment

Also, want to give a shout out to Julie Yack for inspiring me to start a blog.  I attended a Social Media interactive discussion she was facilitating at Convergence 2010.  If you find this blog useful, check out her blog as well.

http://julieyack.blogs.com/

She worked on a fantastic book that I refer to frequently when working on my CRM project, CRM as Rapid Development Platform.