Web Client issues with Milliseconds in Infor CRM 8.2.1

We recently had a client who ran into issues trying to edit some of their activities in the Infor CRM web client. The same activities could be edited in the Windows client successfully.
When attempting to edit the record in the web client the system throws an exception with event log stack trace shown below.

The issue is that the Infor CRM web client is not handling dates that include milliseconds.

In the underlying SQL queries the entity model attempts to find records based on where conditions containing dates. There where condition looks something like “where datefield = ‘20151014 17:37:11.000′” If your date field is actually something like “20151014 17:37:11.783” then the SQL query does not return the record because the times are not equivalent.

Steps to reproduce:

    • Find an existing or create a new activity.
    • Get the activity ID
    • Run this sql script against the activity ID you get:
update activity set startdate='2015-10-14 17:37:11.783', alarmtime='2015-10-14 17:37:11.783' where activityid='VCZV0A00NY2Z'
    • Now try to edit the activity. You will get the error.
    • Now run this SQL script against the activity ID you get:
update activity set startdate='2015-10-14 17:37:11.000', ALARMTIME='2015-10-14 17:37:11.000' where activityid='VCZV0A00NY2Z'
  • The activity can now be edited.

To fix this you can run a SQL script like this

update sysdba.activity set alarmtime = DATEADD(ms, -DATEPART(ms, alarmtime), alarmtime) where datepart(ms, alarmtime)>0
update sysdba.activity set StartDate = DATEADD(ms, -DATEPART(ms, StartDate), StartDate) where datepart(ms, StartDate)>0

Using the SQL function getdate() or getutcdate() includes milliseconds so if you are populating dates directly in SQL you can get this behavior. You can instead use a different SQL function to get the date with no milliseconds specified:

select CONVERT(DATETIME2(0),SYSDATETIME()) --gets local date time
select CONVERT(DATETIME2(0),SYSUTCDATETIME()) --gets UTC current date time

Stack Trace:

"slxErrorId": "SLXCF3F7BA36D6FB743",
"mitigation": "AjaxMessagingServiceError (500)",
"date": "2016-03-16T08:07:45",
"utc": "2016-03-16T15:07:45",
"message": "Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [Sage.SalesLogix.Activity.Activity#VCZV0A00NY2Z].",
"source": "NHibernate.Persister.Entity.AbstractEntityPersister, NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4",
"type": "NHibernate.StaleObjectStateException",
"stackTrace": " at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)\r\n at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)\r\n at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)\r\n at NHibernate.Action.EntityUpdateAction.Execute()\r\n at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)\r\n at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)\r\n at NHibernate.Engine.ActionQueue.ExecuteActions()\r\n at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)\r\n at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)\r\n at NHibernate.Impl.SessionImpl.Flush()\r\n at Sage.SalesLogix.Activity.Entities.Activity.Save() in c:\\Users\\Administrator\\AppData\\Roaming\\Sage\\Platform\\Output\\implementation\\Activity.cs:line 1505\r\n at Sage.SalesLogix.Activity.Activity.Save()\r\n at Sage.SalesLogix.Activity.Entities.Activity.Sage.Platform.Orm.Interfaces.IPersistentEntity.Save() in c:\\Users\\Administrator\\AppData\\Roaming\\Sage\\Platform\\Output\\implementation\\Activity.cs:line 1621\r\n at Sage.Platform.NHibernateRepository.NHibernateRepository.SaveImpl(Object instance)\r\n at Sage.Platform.NHibernateRepository.NHibernateRepository.Sage.Platform.Repository.IRepository.Save(Object instance)\r\n at Sage.Platform.EntityFactory.Save(Object instance)\r\n at Sage.SalesLogix.SystemAdapter.Activities.ActivityRequestHandler.SaveEntity(IActivity entity)\r\n at Sage.Platform.SData.RequestHandlerBase`3.InternalPut(SDataUri uri, String ifMatch, TFeedEntry entry)\r\n at Sage.Platform.SData.RequestHandlerBase`3.Put(TFeedEntry entry)\r\n at Invoke3cd06cf009c44daabf3b80c0c55a4460.Invoke(Object , IRequest )\r\n at Sage.Integration.Messaging.RequestTargetRegistration.RequestTargetInvoker.Invoke(IRequest request)\r\n at Sage.Integration.Messaging.Request.Process(RequestTargetInvoker invoker)\r\n at Sage.Integration.Adapter.AdapterController.RealAdapterController.Process(IRequest request)\r\n at Sage.Integration.Adapter.AdapterController.RealAdapterController.ProcessWorker(IProtocolRequest protocolRequest)\r\n at Sage.Integration.Adapter.AdapterController.Process(IProtocolRequest request)\r\n at Sage.Integration.Messaging.MessagingService.Process(IProtocolRequest protocolRequest)",
"targetSite": "Boolean Update(System.Object, System.Object[], System.Object[], System.Object, Boolean[], Int32, System.Object, System.Object, NHibernate.SqlCommand.SqlCommandInfo, NHibernate.Engine.ISessionImplementor)",
"fullException": "Sage.Common.Syndication.DiagnosesException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [Sage.SalesLogix.Activity.Activity#VCZV0A00NY2Z] ---> NHibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [Sage.SalesLogix.Activity.Activity#VCZV0A00NY2Z]\r\n at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)\r\n at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)\r\n at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)\r\n at NHibernate.Action.EntityUpdateAction.Execute()\r\n at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)\r\n at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)\r\n at NHibernate.Engine.ActionQueue.ExecuteActions()\r\n at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)\r\n at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)\r\n at NHibernate.Impl.SessionImpl.Flush()\r\n at Sage.SalesLogix.Activity.Entities.Activity.Save() in c:\\Users\\Administrator\\AppData\\Roaming\\Sage\\Platform\\Output\\implementation\\Activity.cs:line 1505\r\n at Sage.SalesLogix.Activity.Activity.Save()\r\n at Sage.SalesLogix.Activity.Entities.Activity.Sage.Platform.Orm.Interfaces.IPersistentEntity.Save() in c:\\Users\\Administrator\\AppData\\Roaming\\Sage\\Platform\\Output\\implementation\\Activity.cs:line 1621\r\n at Sage.Platform.NHibernateRepository.NHibernateRepository.SaveImpl(Object instance)\r\n at Sage.Platform.NHibernateRepository.NHibernateRepository.Sage.Platform.Repository.IRepository.Save(Object instance)\r\n at Sage.Platform.EntityFactory.Save(Object instance)\r\n at Sage.SalesLogix.SystemAdapter.Activities.ActivityRequestHandler.SaveEntity(IActivity entity)\r\n at Sage.Platform.SData.RequestHandlerBase`3.InternalPut(SDataUri uri, String ifMatch, TFeedEntry entry)\r\n at Sage.Platform.SData.RequestHandlerBase`3.Put(TFeedEntry entry)\r\n at Invoke3cd06cf009c44daabf3b80c0c55a4460.Invoke(Object , IRequest )\r\n at Sage.Integration.Messaging.RequestTargetRegistration.RequestTargetInvoker.Invoke(IRequest request)\r\n at Sage.Integration.Messaging.Request.Process(RequestTargetInvoker invoker)\r\n at Sage.Integration.Adapter.AdapterController.RealAdapterController.Process(IRequest request)\r\n at Sage.Integration.Adapter.AdapterController.RealAdapterController.ProcessWorker(IProtocolRequest protocolRequest)\r\n at Sage.Integration.Adapter.AdapterController.Process(IProtocolRequest request)\r\n at Sage.Integration.Messaging.MessagingService.Process(IProtocolRequest protocolRequest)\r\n --- End of inner exception stack trace ---",
"hashCode": "FA95BF4E-5A43D045-FC7846A0",
"pid": 3716,
"identity": {
"name": "0017596",
"isAuthenticated": true,
"authenticationType": "Forms"
},
"version": "8.2.0.1211",
"logger": {
"level": "ERROR",
"location": "Sage.Platform.Diagnostics.ErrorHelper.LogException(:0)",
"name": "Global",
"message": "Integration Messaging MessagingService unhandled exception [Saleslogix Error Id=SLXCF3F7BA36D6FB743]"
},
"request": {
"looksLikeAjax": true,
"isLocal": true,
"method": "PUT",
"url": "http://localhost/SlxClient/slxdata.ashx/slx/system/-/activities(\"VCZV0A00NY2Z\")?_compact=true&include=%24descriptors&format=json&_t=1458140865357",
"referrer": "http://localhost/SlxClient/Account.aspx?entityid=ACZV0A00A8KP&modeid=Detail",
"ipAddress": "::1",
"userAgent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36",
"userLanguages": "en-US; en;q=0.8"
},
"extendedExceptionInfo": [
{
"type": "NHibernate.StaleObjectStateException",
"message": "Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [Sage.SalesLogix.Activity.Activity#VCZV0A00NY2Z]",
"source": "NHibernate",
"targetSite": "Boolean Update(System.Object, System.Object[], System.Object[], System.Object, Boolean[], Int32, System.Object, System.Object, NHibernate.SqlCommand.SqlCommandInfo, NHibernate.Engine.ISessionImplementor)",
"stackPosition": 1,
"entityName": "\"Sage.SalesLogix.Activity.Activity\"",
"identifier": "\"VCZV0A00NY2Z\""
}
],
"browser": {
"type": "Chrome49",
"name": "Chrome",
"version": "49.0",
"majorVersion": 49,
"minorVersion": 0.0,
"platform": "WinNT"
},
"server": {
"machineName": "SERVER",
"timeZone": "Pacific Standard Time",
"commandLine": "C:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe -ap \"Saleslogix\" -v \"v4.0\" -l \"webengine4.dll\" -a \\\\.\\pipe\\iisipmf4ae07a0-527e-4a72-b137-6a46c798241c -h \"C:\\inetpub\\temp\\apppools\\Saleslogix\\Saleslogix.config\" -w \"\" -m 0",
"versionString": "Microsoft Windows NT 6.2.9200.0",
"is64BitOperatingSystem": true,
"host": {
"siteName": "Saleslogix",
"applicationId": "/LM/W3SVC/2/ROOT/SlxClient",
"applicationPhysicalPath": "c:\\inetpub\\wwwroot\\SlxClient\\",
"applicationVirtualPath": "/SlxClient",
"isDebuggingEnabled": false,
"isHosted": true,
"maxConcurrentRequestsPerCPU": 5000,
"maxConcurrentThreadsPerCPU": 0
},
"logonUser": {
"name": "SERVER\\WebDLL",
"authenticationType": "Forms",
"impersonationLevel": "Impersonation",
"isAnonymous": false,
"isGuest": false,
"isSystem": false
}
}
}
ABOUT THE AUTHOR

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!