back to top

Another Issue Discovered in Infor CRM v8.1 Update 5- Sales Process Activity Dates Are Off

We had a client who discovered when clicking to create a timeless Activity from a Opportunity Sales Process step, the dates were one day off (behind).  In the Sales Process you can define the number of days in the future the Activity is to be created for.  So if you have an Activity that is to get created 4 days in the future, when you click to create the Activity from a Sales Process, the date would actually default to 3 days in the future.  I dug around and never really found the problem, but did find a fix to resolve the issue.

The creation of activities from the Sales Process tab is handled by a custom smart part in the OpportunitySalesProcess folder called SalesProcessService.aspx.  Inside the SalesProcessService.aspx.cs code file there is a method used called “ScheduleActivity” which returns a string of a new Activity ID.  Inside this method there is a call to get the SalesProcessAudit entity which is passed into the method as a parametrized array.

            ISalesProcessAudit spAudit = EntityFactory.GetById<ISalesProcessAudit>(spaId);
            if (spAudit != null)
            {
                IContact contact = EntityFactory.GetById<IContact>(contactId);
                IOpportunity opp = EntityFactory.GetById<IOpportunity>(opportunityId);
                IUser leader = EntityFactory.GetById<IUser>(leaderId);
                Activity activity = (Activity)spAudit.SalesProcess.ScheduleActivity(spaId, opp, leader, contact, true);
                activityId = (string) activity.Id;
            }  

The spAudit.SalesProcess.ScheduleActivity is a business rule in the SalesProcess entity.  Unfortunately, this is contained in the compiled Sage.Saleslogix.BusinessRules.dll and can’t be modified.  What it does is to parse out the details of the step that was clicked and then create an activity with these parameters.  The result of that is an Activity record.  Luckily with this Activity object being returned by the compiled method we can edit the results to correct the problem.  The only issue remaining is to do our own parsing of the step to get the step’s details. If we add our own code between these two lines:

                Activity activity = (Activity)spAudit.SalesProcess.ScheduleActivity(spaId, opp, leader, contact, true);
                activityId = (string) activity.Id;

We can do just that:

                //CFX Added to fix sales process being one day off               
                DateTime today = DateTime.Today;
                string xmlData = Encoding.UTF8.GetString(spAudit.Data);
                System.Xml.XmlDocument document = new System.Xml.XmlDocument();
                document.LoadXml(xmlData);
                System.Xml.XmlNode node = document.DocumentElement.SelectSingleNode(“//Action/ActivityAction”);
                string innerText = node.SelectSingleNode(“Type”).InnerText;
                string daysOut = node.SelectSingleNode(“ScheduleDaysFromToday”).InnerText;
                string tml = node.SelectSingleNode(“Timeless”).InnerText;
                bool timeless = tml == “T”;
                int num = (daysOut != string.Empty) ? int.Parse(daysOut) : 0;

                if (timeless)
                {
                    activity.Notes = “Days: ” + num.ToString() + “Currently: ” + activity.StartDate.ToString(“MMddyyyy hh:mm:ss”) + ” | ” + today.Date.ToString(“MMddyyyy hh:mm:ss”) + ” | ” + today.AddDays(4).Date.AddSeconds(5).ToString(“MMddyyyy hh:mm:ss”);
                    activity.LongNotes = activity.Notes;
                    activity.StartDate = today.AddDays(num).Date.AddSeconds(5);
                    activity.Timeless = true;
                    activity.Save();
                }
                //End CFX Add to fix sales process being one day off

So the final code is:

    private string ScheduleActivity(string scheduleContext)
    {

        string activityId = string.Empty;
        try
        {
            string[] args = scheduleContext.Split(new Char[] { ‘,’ });
            string spaId = args[0];
            string contactId = args[1];
            string opportunityId = args[2];
            string leaderId = args[3];
            ISalesProcessAudit spAudit = EntityFactory.GetById<ISalesProcessAudit>(spaId);
            if (spAudit != null)
            {
                IContact contact = EntityFactory.GetById<IContact>(contactId);
                IOpportunity opp = EntityFactory.GetById<IOpportunity>(opportunityId);
                IUser leader = EntityFactory.GetById<IUser>(leaderId);
                Activity activity = (Activity)spAudit.SalesProcess.ScheduleActivity(spaId, opp, leader, contact, true);

                //CFX Added to fix sales process being one day off               
                DateTime today = DateTime.Today;
                string xmlData = Encoding.UTF8.GetString(spAudit.Data);
                System.Xml.XmlDocument document = new System.Xml.XmlDocument();
                document.LoadXml(xmlData);
                System.Xml.XmlNode node = document.DocumentElement.SelectSingleNode(“//Action/ActivityAction”);
                string innerText = node.SelectSingleNode(“Type”).InnerText;
                string daysOut = node.SelectSingleNode(“ScheduleDaysFromToday”).InnerText;
                string tml = node.SelectSingleNode(“Timeless”).InnerText;
                bool timeless = tml == “T”;
                int num = (daysOut != string.Empty) ? int.Parse(daysOut) : 0;

                if (timeless)
                {
                    activity.Notes = “Days: ” + num.ToString() + “Currently: ” + activity.StartDate.ToString(“MMddyyyy hh:mm:ss”) + ” | ” + today.Date.ToString(“MMddyyyy hh:mm:ss”) + ” | ” + today.AddDays(4).Date.AddSeconds(5).ToString(“MMddyyyy hh:mm:ss”);
                    activity.LongNotes = activity.Notes;
                    activity.StartDate = today.AddDays(num).Date.AddSeconds(5);
                    activity.Timeless = true;
                    activity.Save();
                }
                //End CFX Add to fix sales process being one day off

                activityId = (string) activity.Id;
            }          
        }
        catch
        {
            activityId = string.Empty;
        }
        return activityId;
    }

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 Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos