I use the ticket activities extensively. One of the things that I didn't quite enjoy with out-of-the-box SalesLogix Web ticket activities is the inability to put in a number of hours and have the system compute the begin time based on the units entered. So... I created a business rule that allows us to do just that.
If you find joy in this, you'll have to change the ticket activity form to set the elapsed units to Read Only = false. Then the OnChange event to call the business rule below:
public static void DoActivityCalcOnElapsedStep( ITicketActivity ticketactivity)
{
//First check to see if we have a completed datetime already...
DateTime? completedDate = ticketactivity.CompletedDate;
DateTime time = completedDate.HasValue ? completedDate.GetValueOrDefault() : DateTime.UtcNow;
ticketactivity.CompletedDate = new DateTime?(time);
//Set the CompletedDate and back calculate the Assigned (or start) date...
Double minutes = Convert.ToDouble(ticketactivity.ElapsedUnits);
minutes = (minutes * 60) * -1;
time=time.AddMinutes(minutes);
ticketactivity.AssignedDate = time;
}
If you find a way to improve the code snippet... please let me know.
My friends at Sage... feel free to add this to the next release
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We want to hear your cool ideas for enhancing Saleslogix products and services. So add your own ideas or kudo (vote) on the ideas of others here! Watch the most valuable bubble to the top!
I have an idea! How do I get started?
One