Request a topic or
contact an Arke consultant
All posts by eric stoll

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




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

© Copyright 2023

Custom Email Fields for WFFM

Have you ever needed to create a custom field type for Sitecore Web Forms for Marketers (WFFM)? Have you ever then needed to use that field type in the Send Email Message action in the To/From/CC field? By default, that editor only lets you select field of type Email. Here’s how you extend it to allow additional field types.

  1. Find the /sitecore/system/Modules/Web Forms for Marketers/Settings/Actions/Save Actions/Send Email Message item.
  2. Add this to the QueryString field:


NOTE: {84ABDA34-F9B1-4D3A-A69B-E28F39697069} is the out of the box Email type, then add your custom types after that separated by a pipe.


Now when you use the Send Email Message save action, your custom type will appear in the To field. To control the other email fields on that dialog, use the following querystring parameters.

  • AllowedToTypes
  • AllowedFromTypes
  • AllowedCCTypes
  • AllowedSubjectTypes

For more specific information, reference “Sitecore.Forms.Shell.UI.Dialogs.SendMailEditor, Sitecore.Forms.Core” with Reflector.

Posted by Eric Stoll on Saturday, August 2, 2014 2:05 PM
Permalink | Comments (0) | Post RSSRSS comment feed

CRM 2011 Claims Based Authentication and CrmSvcUtil.exe

The crmsvcutil program has some lousy code in it that breaks when you are using "Claims based authentication" (which is used for Internet Facing Deployments - IFD).

This error shows up as:

" Exiting program with exception: The logon attempt failed

Enable tracing and view the trace files for more information."

The fine folks at adxstudio have provided a dll that you can use to work around the problem.

This is specifically for the 5.0.3 version of the SDK, which is the one currently available today at

Presumably MS will fix this in the next SDK release.

Put the dll into the bin directory that has your crmsvcutil, and then add to your command line:

/metadataproviderservice:"MetadataProvider.IfdMetadataProviderService, MetadataProvider" /codecustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"

For example, a working command line is:

C:\projects\crm2011\sdk5.0.3\sdk\bin>crmsvcutil /url:https://CRM.YOURCOMPANY.COM/xrmservices/2011/organization.svc /out:xrm.cs /u[username] /p:"[passwordgoeshere]" /metadataproviderservice:"MetadataProvider.IfdMetadataProviderService, MetadataProvider" /codecustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"

The root cause is the MS crmsvcutil included this code:

if (orgServiceConfig.AuthenticationType != AuthenticationProviderType.LiveId)

which doesn't account for IFD using AuthenticationProviderType.Federation

(bug found in

Posted by Eric Stoll on Monday, May 23, 2011 1:43 AM
Permalink | Comments (0) | Post RSSRSS comment feed

DotNetNuke PurgeScheduleHistory

DotNetNuke runs a task to purge it’s schedule history; however, the stored procedure that does this has performance problems that will cause deadlocks on a high traffic website.

The query that the PurgeScheduleHistory stored procedure ships with is:

DELETE FROM dbo.ScheduleHistory
FROM dbo.Schedule s
  FROM dbo.ScheduleHistory sh with (nolock)
  WHERE sh.ScheduleID = ScheduleHistory.ScheduleID
  AND sh.StartDate >= ScheduleHistory.StartDate
) > s.RetainHistoryNum
AND s.RetainHistoryNum <> -1
AND s.ScheduleID = ScheduleHistory.ScheduleID

Anytime you write a query that does a delete from a select you run the risk of deadlock.  Also, whenever you do a sweeping delete on a table you can escalate to a page lock, have trouble with locking indexes, and end up in a deadlock scenario again.  On the surface this doesn’t sound like a deadlock scenario, but you have to understand the way locks affect indexes and how locks escalate in SQL Server—you might be surprised to learn a simple SELECT query can deadlock under the right conditions also (

The fix to this stored procedure follows the same approach Microsoft used to fix the DeleteExpiredSessions stored procedure that ships with ASP.NET (

The following query should replace the PurgeScheduleHistory stored procedure:

ALTER PROCEDURE [dbo].[PurgeScheduleHistory]



create table #T (ID int not null primary key)

insert into #T
select schedulehistoryid from (
select s.ScheduleID, sh.schedulehistoryid, rank() over (partition by s.scheduleid order by sh.startdate) rn, RetainHistoryNum
from ScheduleHistory sh WITH (READUNCOMMITTED)
join Schedule s WITH (READUNCOMMITTED) on s.ScheduleID = sh.ScheduleID
where s.RetainHistoryNum <> -1) a
where rn > RetainHistoryNum


declare @ID int

open ESC

fetch next from ESC into @ID

        DELETE FROM ScheduleHistory WHERE ScheduleHistoryID = @ID



drop table #T

Thanks to David Eison for finding this solution.

Categories: SQL Server | ASP.NET | DotNetNuke
Posted by Eric Stoll on Wednesday, February 16, 2011 1:13 AM
Permalink | Comments (0) | Post RSSRSS comment feed

CRM 4 to CRM 2011: SetFieldRequiredOrRecommended

The constant parameter for SetFieldRequiredOrRecommended has changed in CRM 2011.

CRM 4 CRM 2011
SetFieldRequiredOrRecommended(crmForm.all.new_notbillablereason_c, FORM_FIELD_TYPE_NORMAL, ""); SetFieldRequiredOrRecommended(crmForm.all.new_notbillablereason_c, FIELD_NOT_REQUIRED, "");
SetFieldRequiredOrRecommended(crmForm.all.new_notbillablereason_c, FORM_FIELD_TYPE_RECOMMENDED, ""); SetFieldRequiredOrRecommended(crmForm.all.new_notbillablereason_c, FIELD_RECOMMENDED, "");
SetFieldRequiredOrRecommended(crmForm.all.new_notbillablereason_c, FORM_FIELD_TYPE_REQUIRED, ""); SetFieldRequiredOrRecommended(crmForm.all.new_notbillablereason_c, FIELD_REQUIRED, "");

Posted by Eric Stoll on Wednesday, October 13, 2010 9:54 AM
Permalink | Comments (0) | Post RSSRSS comment feed

SQL 2008 Won’t Install – Error About Conflict with SQL 2005 Express

I’ve been fighting an error trying to install SQL 2008 R2.  The installer gives an error, “The SQL Server 2005 Express Tools are installed. To continue, remove the SQL Server 2005 Express Tools.”  It turns out, the error was due to Red Gate SQL Compare, not SQL 2005.  Thanks to this article, I was able to uninstall Red Gate to get SQL 2008 R2 installed.

Posted by Eric Stoll on Thursday, May 27, 2010 1:55 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Nicer Sitecore URL’s

Sitecore has a concept for replacing special characters in a URL. By default, their config file isn’t set to translate spaces. So URLS like, World.aspx translate to For SEO purposes, its best to translate spaces. Add the following line to your Sitecore web.configs so the URL would translate to

    <replace mode="on" find="&amp;" replaceWith=",-a-," />
    <replace mode="on" find="?" replaceWith=",-q-," />
    <replace mode="on" find="/" replaceWith=",-s-," />
    <replace mode="on" find="*" replaceWith=",-w-," />
    <replace mode="on" find="." replaceWith=",-d-," />
    <replace mode="on" find=":" replaceWith=",-c-," />
    <replace mode="on" find=" " replaceWith="-" />

Posted by Eric Stoll on Tuesday, May 18, 2010 10:32 AM
Permalink | Comments (1) | 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.




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

WSS 3 Tool Version 1.2 for Visual Studio 2008 Released

Tools for developing custom SharePoint applications: Visual Studio project templates for Web Parts, site definitions, and list definitions; and a stand-alone utility program, the SharePoint Solution Generator.

Posted by eric stoll on Friday, June 27, 2008 1:48 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Troubleshooting IIS Authentication Problems - 401.1 HTTP Error

I ran into a strange authentication problem in IIS on Windows Server 2003 SP1.  The website is configured for integrated authentication only.  I can authenticate and access the website no problem from any workstation on the network.  But from the console, I cannot access the website--it gives me a 401.1 HTTP error.  Strange.  The server can talk to the domain because I logged into the machine.  DNS looked good.

I ran across this little utility called AuthDiag.

AuthDiag directed me to a strange error message in the security logs, which led me to this KB article.;en-us;896861

Specifically from the article...

This issue occurs if you install Microsoft Windows XP Service Pack 2 (SP2) or Microsoft Windows Server 2003 Service Pack 1 (SP1). Windows XP SP2 and Windows Server 2003 SP1 include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name.

I decided to go with option 1 and set DisableLoopbackCheck to 1 and this fixed my problem.

Posted by eric stoll on Thursday, June 26, 2008 9:49 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Troubleshooting CRM 4 Issues

CRM can be challenging to troubleshoot with log files scattered across several servers and often underlying problems that don't even appear in the logs.  I stumbled upon this diagnostic tool that was helpful in finding the problem with an SRS install.  Enjoy!

Posted by eric stoll on Wednesday, June 25, 2008 7:21 PM
Permalink | Comments (0) | Post RSSRSS comment feed