Need updating time Units in ticket activities Entity?

Updating Time Units

Recently I was asked to customize the add/edit ticket activities form in SalesLogix (now known as InforCRM) so that when users click the save button it will auto populate the Completed Date field with the current date and time. The other requirement is the units needsto be rounded up so that’s easy. I made the changes as requested and it did save the value of the Completed Date. However Unfortunately no matter how long is the duration between assigned date and completed date, the time units were always 0. Weird huh?

No matter how I set the Units property when I called .save() it will set it back to 0. I tried using snippet code and on before insert/on after insert Business rules but still no luck. it will always set it to 0.

so this is the work around that I came up with

ticketActivity.CompletedDate = DateTime.Now.AddSeconds(30);
ticketActivity.Save();
object[] objarray = new object[] { this.BindingSource.Current };
Sage.Platform.EntityFactory.Execute("TicketActivity.DoTicketActivityCalculations", objarray);

Calling the DoTicketActivityCalculations method will set the units and it works perfectly. I don’t know if everybody but me knew this but thought I’d share.

Share This