Request a topic or
contact an Arke consultant
404-812-3123
Arke Systems Blog | Useful technical and business information straight from Arke.

Arke Systems Blog

Useful technical and business information straight from Arke.

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Archive

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2013

Raw users in CRM

CRM decides which user account to use by finding the logged in user’s ObjectSID in the MSCRM database systemuserauthentication table.

You can get your ObjectSID out of Active Directory ( dsa.msc ) if you have a 32 bit server by registering a dll from the windows server 2003 resource toolkit ( http://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe ) (I don't know how to make it work on 64 bit; docs say 64 bit is not supported) - install toolkit, copy acctinfo.dll to c:\windows\system32 (copy step may not be necessary), "regsvr32 acctinfo.dll".  Then browse to user in AD ( start/run/dsa.msc ) and look at the 'additional account info' tab (doesn't show up when user is found using find, unfortunately).

Now that you have an ObjectSID, that can be found in the authinfo column of systemuserauthentication , which gives you a userid.  You can use that userid to query systemuser and get a default organization id; You can use that organizationid and userid to query systemuserorganizations , which gives you a crmuserid.  Finally this crmuserid guid is the systemuser id for your actual organization’s CRM database.  Note that the two different systemuser tables are unrelated and use different guids; one is for the crm config db, and one is for your organization crm db.


Posted by David Eison on Thursday, April 22, 2010 4:11 PM
Permalink | Comments (0) | Post RSSRSS comment feed

CRM Custom Workflows and “This workflow includes an invalid reference”

When using a custom workflow dll in CRM, make sure to register it with the same GUIDs on production as you do on your dev CRM server.  You can do this easily by using export/import from the plugin registration tool.

When you make a workflow, anything that uses a step from the custom workflow will end up referring to it by GUID.  So if the guids don’t match for the dll, you can’t import/export workflows between the environments. And it’s not an easy fix by editing guids in the customization export file, because workflows are serialized inside this file.

If you find out about the problem early, you can unregister and reregister the dll with the right GUID.  If you find out about the problem late, after someone has already developed workflows separately in both environments, you may need to delete anything that uses data from the custom dll and recreate those workflow steps.

It shows up as an error message of “This workflow contains errors and cannot be published”, and “This workflow includes an invalid reference”.  (The invalid reference message is a generic there-is-a-guid-that-doesnt-match error, it could also be referring to a record like a system user.)


Posted by David Eison on Saturday, April 17, 2010 1:37 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Debugging with Visual Studios (SQLite error)

I’ve run into a reoccurring error that only pushes to the surface while debugging.  The following error:

Could not load file or assembly 'System.Data.SQLite, Version=1.0.48.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Is a result of IIS and the windows box trying to run 32 vs 64 bit versions of the application and of the sqlLite.dll.  There are two dlls involving sqlLite.  One is System.Data.SQLite, the other System.SQLite.  If you don’t require SQLite in your project, remove it or rename it from a .dll extension.  See post for Web Forms for Marketers on how SQLite might affect you.  If you must use SQLite, it is recommended that you download the correct version of the dll from here: http://www.sqlite.org/download.html 

**There have been issues with people running the application after downloading the correct 64 version of the dll and running sitecore as a 64 bit application.  Be sure you have .NET SP 1 installed on your VM or other.


Tags: , , , ,
Categories: Sitecore
Posted by Nicole Rodriguez on Monday, April 12, 2010 12:37 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Web Form for Marketers

For those just downloading the installer, check inside your downloaded file first (and ALWAYS for future packages) and be sure that there is only one zip inside called 'package.zip'.  Do not unzip that file.  Sometimes they wrap the package in another zip for downloading off their website.  If you do not catch a double zipped package, you bring doom and reinstall for your application.  Follow the instructions on installing packages as suggested on www.sdn.sitecore.net .  After installing, it is not a finished out of the box product.  Follow the instructions below.

To submit forms (Associated Error: ‘We experience a technical difficulty while processing your request. Your data may not have been correctly saved.’) 

-          Open SQL Server and attach database located in Website/Data/Sitecore_WebForms.mdf

-          Open forms.config file in Website/App_Config/Include/forms.config

-          Uncomment the mssql connection string and add the proper fields

-          Open connecitonstrings.config in Website/App_Config/Connectionstrings.config

-          (The magic.) Add this to your config: <add name="remoteWfmService" connectionString="url=http://localhost/sitecore%20modules/shell/Web%20Forms%20for%20Marketers/Staging/WfmService.asmx;user=admin;password=b;timeout=60000"/>

-          Test.


Categories: Sitecore
Posted by Nicole Rodriguez on Monday, April 12, 2010 12:31 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Dynamics CRM 5 CTP3 announced!

For those of you like me that have been slavering at the chance to get your hands on CRM5 to see everything they've done with it, CTP3 has been announced!  This isn't a public preview yet (we're still months out, there), but it's a start!

When I get a copy, I'll post about some of the best features from a back-end perspective.  I'm especially interested in the application isolation they've been touting for a while now.  To get a taste of what's been announced so far, hit up this announcement from PDC last year.


Posted by Wayne Walton on Thursday, March 25, 2010 9:54 PM
Permalink | Comments (0) | Post RSSRSS comment feed

SQL Server DateTime

SQL Server DateTime get 3.3ms resolution at best, and an officially unspecified amount worse than that at worst, depending on hardware and bugs on the target system.

In practice, it’s not enough resolution to allow adding a DateTime to make a row unique.  Uniqueness is best achieved with either a GUID or a rowversion (“TimeStamp”, which is confusingly named in that it is just a sequentially incrementing rowversion and so has nothing to do with the clock); special cases like “this state should only happen once” should generally be done with unique constraints that accurately model whatever contributes to the state involved.

DateTime resolution is likely to actually be more like 10ms or 15ms due to Windows NT clock (See 15ms comment in http://v8.googlecode.com/svn/trunk/src/platform-win32.cc ; MSDN article at http://msdn.microsoft.com/en-us/magazine/cc163996.aspx )

SQL Server timing functions http://msdn.microsoft.com/en-us/library/ms186724.aspx notes:

“Higher-Precision System Date and Time Functions

SQL Server 2008 obtains the date and time values by using the GetSystemTimeAsFileTime() Windows API. The accuracy depends on the computer hardware and version of Windows on which the instance of SQL Server is running. The precision of this API is fixed at 100 nanoseconds. The accuracy can be determined by using the GetSystemTimeAdjustment() Windows API.“

-David


Posted by David Eison on Monday, December 07, 2009 6:52 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Sql Server Recursive Joins

Sometimes a client wants to know why they shouldn’t just stick with Sql Server 2000.  There are many compelling reasons to use Sql Server 2005 or 2008 over 2000, but for today I’ll focus on just one: Recursive Joins.

One criticism of SQL Server years ago when I first started using it was that it didn’t have Oracle’s “connect by” feature, which let you do recursive joins, which basically let you do tree based queries in SQL.  You have a table with a “parentid” column, and with a recursive join you can walk up or down the tree and get all the descendents or all the parents of an object.

Addressing this need, SQL Server added some recursive join features in 2005 and 2008.  It can be hard to google because “sql server connect by” has hundreds of pages saying “can’t be done in sql server” and pointing to the “sql for smarties” nested sets solution (which uses triggers to maintain extra sorting rows to make querying trees possible).

“with” was added in 2005 as the syntax for working with “Common Table Expressions”.  See http://consultingblogs.emc.com/christianwade/archive/2004/11/09/234.aspx

The basic idea is you establish a base to work from with a simple select, then union in the children (or parents or whatever) of the base, and your subquery in the union can refer back to the base as whatever you named it in the ‘with’.

2008 takes it one step further and lets you store the hierarchy path in the data model with HierarchyID. http://msdn.microsoft.com/en-us/magazine/cc794278.aspx  This makes the data model a little less obvious to work with but looks like a good way to go if you’re developing a new data model.  I happen to be working with an existing tree table so I’m sticking to ‘with’ for now.

An example “with” query to show all of the not-deleted category tree in ASPDotNetStorefront  (intentionally including unpublished categories, but you could easily exclude them):


with c as ( 
  select cast('/'+name as varchar(1000)) as pth,categoryid,displayorder,name,0 as lvl 
   from dbo.Category c1 
   where c1.ParentCategoryID=0 and Deleted=0 
 union all 
  select cast(c.pth+'/'+c1.name) as varchar(1000)) as pth, c1.categoryid, c1.displayorder, c1.name, lvl+1 as lvl 
   from dbo.category c1 join c on c1.ParentCategoryID = c.CategoryID
   where c1.Deleted=0
)
select lvl, c.pth
 from c join dbo.category c1 on c.categoryid = c1.categoryid
 order by lvl,c.displayorder,c.pth;

Posted by David Eison on Thursday, December 03, 2009 1:11 PM
Permalink | Comments (0) | Post RSSRSS comment feed

User an Inner Tube DIV Instead of Padding

Making sure things are cross browser compatible is always a challenge.  But a general rule of thumb is you should just avoid using padding in your CSS.  It’s probably the #1 reason you’ll get cross browser issues.

 

image

 

Avoid using padding in general.  It especially causes issues when you need to set a width in your CSS because you’ll get different results in IE and Firefox.  The better method is to put a div inside a div (called an inner tube) and set margin on the inner div.


Posted by Eric Stoll on Thursday, November 19, 2009 9:39 AM
Permalink | Comments (0) | Post RSSRSS comment feed

IIS 6 Compression Review

There’s a lot of information out there on IIS compression.  Especially for what seems like it should be a simple topic…

Here are a few things I haven’t seen collected well in one spot:

1) Don’t test your compression settings from behind ISA.  Two reasons: ISA can strip the accept compression header to allow it to inspect content, and some of the default IIS settings are to not compress for web proxies (apparently some web proxies have trouble with compression).

2) There are two sources of troubles with compression:

  • Proxies serving compressed content to web browsers that don’t support compression.  There are two ways to address this in IIS 6: Either don’t serve compressed content to proxies by setting HcNoCompressionForProxies to true, or else set HcSendCacheHeaders to true and use the default in-the-past HcExpiresHeader & HcCacheControlHeader values so that proxies will consider the file expired and not cache it.
  • Web browsers that claim to support compression but don’t support it properly.  The most common one still in use is some versions of IIS 6 (see for example http://support.microsoft.com/kb/825057 ).  A good list of compression compatability issues is at http://schroepl.net/projekte/mod_gzip/browser.htm .  The safest thing to do is to not serve compressed to IE6.  Unfortunately, there is no simple way to do this in IIS 6.   (the Microsoft Ajax library automatically does this for its files if you use its compression). 

3) If you are using Microsoft’s AJAX (ScriptResource.axd) it can do compression separately from IIS, but if you have both do compression you will break things.  So either configure IIS to NOT compress AXD and set the scriptResourceHandler enableCompression="true" flag, or else configure IIS to compress AXD and set scriptResourceHandler enableCompression to false.  Note that you may have problems with other AXD files depending on what sort of content they produce.


Posted by David Eison on Tuesday, September 01, 2009 5:28 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Log4net and web gardens

If you actually want to use more than 1 processor for a website on your fancy multi-processor server (IIS calls this a “web garden” because marketers like to brand new terms for existing technologies), and you’re using a log4net file appender, a default configuration will cause problems for you as your separate web server processes run into locks on the same log file.  To avoid this, you’ll need to configure log4net to put the PID in the filename:

e.g.

<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">

. . .

<file type="log4net.Util.PatternString" value="C:\\IISLogs\\project\\log.pid.%processid.d" />

. . .

<datePattern value="yyyyMMdd'.txt'" />

Unfortunately, this ruins easy filename based date sorting. Don’t know how to do anything about that.

I recommend avoiding the ‘MinimalLock’ configuration that you will see mentioned in google searches. It opens and closes the file for every log message; while I haven’t tested this specifically with log4net, I have run into several apps in the past that ruined their performance by excessive file opening and seeking.


Posted by David Eison on Tuesday, September 01, 2009 4:40 PM
Permalink | Comments (0) | Post RSSRSS comment feed