Updating Time Units in Ticket Activities entity
Posted By: Doddy.Amijaya on February 14th, 2014 in Saleslogix
No Gravatar

Recently I’ve got a request to customize add/edit ticket activities form 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 needs to 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 is 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.


Leave a Reply