back to top

Infor CRM error logging in “query did not return a unique result: 2.”

We recently ran into an issue where a client was suddenly unable to login to the web client at all. As soon as they entered their credentials into the Login page, an error would occur. Looking into the event logs the stack trace was:

“message”: “query did not return a unique result: 2.”,
“source”: “NHibernate.Impl.AbstractQueryImpl, NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4”,
“type”: “NHibernate.NonUniqueResultException”,
“stackTrace”: ” at NHibernate.Impl.AbstractQueryImpl.UniqueElement(IList list)\r\n at NHibernate.Impl.CriteriaImpl.UniqueResult[T]()\r\n at NHibernate.Criterion.QueryOver`1.SingleOrDefault()\r\n at NHibernate.Criterion.QueryOver`1.NHibernate.IQueryOver.SingleOrDefault()\r\n at Sage.SalesLogix.Web.Controls.PageLink.CheckExistHostedHelpLanguage(String helpLang, String appPortalName)\r\n at Sage.SalesLogix.Web.Controls.PageLink.FormatHelpUrl(String helplang, String helpTopic)\r\n at Sage.SalesLogix.Web.Controls.PageLink.GetHelpNavUrlFromFileName(String navUrl)\r\n at Sage.SalesLogix.Web.Controls.PageLink.GetWebHelpLink()\r\n at SmartParts_ClientLinkHandler_ClientLinkHandler.Page_Load(Object sender, EventArgs e)\r\n at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n at System.Web.UI.Control.OnLoad(EventArgs e)\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)”,
“targetSite”: “System.Object UniqueElement(System.Collections.IList)”,
“fullException”: “System.Web.HttpUnhandledException (0x80004005): Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> NHibernate.NonUniqueResultException: query did not return a unique result: 2\r\n at NHibernate.Impl.AbstractQueryImpl.UniqueElement(IList list)\r\n at NHibernate.Impl.CriteriaImpl.UniqueResult[T]()\r\n at NHibernate.Criterion.QueryOver`1.SingleOrDefault()\r\n at NHibernate.Criterion.QueryOver`1.NHibernate.IQueryOver.SingleOrDefault()\r\n at Sage.SalesLogix.Web.Controls.PageLink.CheckExistHostedHelpLanguage(String helpLang, String appPortalName)\r\n at Sage.SalesLogix.Web.Controls.PageLink.FormatHelpUrl(String helplang, String helpTopic)\r\n at Sage.SalesLogix.Web.Controls.PageLink.GetHelpNavUrlFromFileName(String navUrl)\r\n at Sage.SalesLogix.Web.Controls.PageLink.GetWebHelpLink()\r\n at SmartParts_ClientLinkHandler_ClientLinkHandler.Page_Load(Object sender, EventArgs e)\r\n at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n at System.Web.UI.Control.OnLoad(EventArgs e)\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)\r\n at System.Web.UI.Page.HandleError(Exception e)\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)\r\n at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)\r\n at System.Web.UI.Page.ProcessRequest()\r\n at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)\r\n at System.Web.UI.Page.ProcessRequest(HttpContext context)\r\n at ASP.default_aspx.ProcessRequest(HttpContext context)\r\n at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)\r\n at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)”,

After turning on Nhibernate logging using Log4Net I was able to find the problem. So you don’t have to go through that lets see what is going on…

The specific issue is that there is a duplicate row being added into the CUSTOMSETTINGS table. The row was something with CATEGORY=”LocaleConfig” and DESCRIPTION containing “{some value}|webclientLocaleConfig”.

I reviewed the code base of the SLX web client. The only place that writes this value to the CUSTOMSETTINGS table for LocaleConfig row is by going to the web client’s Administration/Office Profiles and then opening the detail record. On the detail screen there is a Help tab. On that tab is a Supported Languages drop down for the web client. When you press the Save button on that tab it calls a standard method called: UpdateLocaleConfig.

This UpdateLocaleConfig code is as follows:

string key = officeprofile.Id.ToString() + "|" + portalName + "LocaleConfig";
MySlx.Data.RemoveFromCache(key);
var factory = EntityFactory.GetRepository<ICustomSetting>();
ICustomSetting setting = factory.FindFirstByProperty("DataKey", key);
if (setting != null) {
setting.DataValue = localeCSV;
}
else {
setting = EntityFactory.Create<ICustomSetting>();
setting.DataKey = key;
setting.Description = key;
setting.Category = "LocaleConfig";
setting.DataValue = localeCSV;
setting.DataType = "Other";
setting.DataValidation = "Any Characters";
}

setting.Save();

The issue here is that it attempts to find the CUSTOMSETTINGS row matching on DATAKAEY using the variable “key” which using the value officeprofile.Id + “|” + portal name + “LocaleConfig.

The issue is that the original row in the CUSTOMSETTINGS table had a datakey value of “7Hrp|Webclientlocaleconfig”. However this code takes the officeprofile.Id and appends that to the rest of the formatted string. The officeprofile.Id is actually a database char(12) field, meaning that the officeprofile.Id returned is not just “7Hrp” but is in fact “7Hrp “. The resulting value it looks for is “7HRP |webclientLocaleConfig”. Since it does not find a row matching “7HRP |webclientLocaleConfig”, because the existing row is “7Hrp|Webclientlocaleconfig”, it adds a new row. This is where the problem comes from.

Other code in the system looks for the CUSTOMSETTINGS value by matching on CATEGORY and DESCRIPTION. When searched this way it finds two matching rows and the system errors out and results in what Harbert saw. By removing the duplicate erroneously added row the web client could log back in.

This does still appear to be an issue in the latest 9.3 version. So if you are receiving this error, hopefully this post will help you to fix things. Infor should change that UpdateLocaleConfig method to get the key value using a trimmed version of the Id, like so:

string key = officeprofile.Id.ToString().Trim() + "|" + portalName + "LocaleConfig";
Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM 10: Phone Number “Starts With” Search Not Working with Formatted Numbers

Infor CRM 10's Starts With search may fail to find phone numbers stored with formatting characters. Learn why this happens, how to identify affected records, and how to resolve the issue.

Increase Attachment Size Allowed in the Infor CRM SLX Web Client

It is possible to increase Infor CRM SLX's limit on the size of a file that can be uploaded by editing values in web.config file.

A Closer Look at the AI Features in Infor CRM v10

Infor CRM v10 includes several built-in Generative AI features that go beyond a simple chatbot. Here's a closer look at AI Summary, AI Assistant, AI Newsfeed, and AI-assisted email drafting.

[Webinar] Infor CRM SLX Admin Essentials: Xbar for Web and Email Marketing

On Tuesday, September 15, 2026, Infor is hosting an...

Infor CRM Mobile 4.4 Now Available: What’s New

Infor CRM Mobile 4.4 is now available for single-tenant cloud and on-premises customers. Explore business card capture, dashboards, workflows, and more.

Related Articles

Infor CRM 10: Phone Number “Starts With” Search Not Working with Formatted Numbers

Infor CRM 10's Starts With search may fail to find phone numbers stored with formatting characters. Learn why this happens, how to identify affected records, and how to resolve the issue.

Increase Attachment Size Allowed in the Infor CRM SLX Web Client

It is possible to increase Infor CRM SLX's limit on the size of a file that can be uploaded by editing values in web.config file.

A Closer Look at the AI Features in Infor CRM v10

Infor CRM v10 includes several built-in Generative AI features that go beyond a simple chatbot. Here's a closer look at AI Summary, AI Assistant, AI Newsfeed, and AI-assisted email drafting.

[Webinar] Infor CRM SLX Admin Essentials: Xbar for Web and Email Marketing

On Tuesday, September 15, 2026, Infor is hosting an administrator-focused webinar covering two areas that can help organizations...

Related Videos