02-01-2010 02:51 PM
Hi Everyone,
Does anyone have code that shows how to set an Activity's prority? I've tried to look in the docs but can't find anything....
Thanx in advance.
T
02-02-2010 05:53 AM
02-02-2010 09:59 AM
Thanx. I'll try that. However, for foreign countries, does the "High" setting apply? Will the priority name in Spain ("Alto") be the same as in the US? I'd think you'd use some sort of number (0 for low, 3 for high, etc.).
Do you have any knowledge on this?
T
02-02-2010 04:51 PM
T,
I always use a dropdownList control that allows the user to select the priority level.
Since I am adding the priority list from the ACT activities class, it handles Current Culture for me
Here is an example code from The Durkin Toolkit designer which now allows users to customize the "Edit Activity" window:
// Set the priority items from the framework into our custom dropdown
Dim cDropDownlist As Durkin.Common.Classes.CustomControls.DropDownListDurkincDropDownlist = DirectCast(cControl, Durkin.Common.Classes.CustomControls.DropDownListDurkin)
cDropDownlist.Items.AddRange(Me.HostFramework.Activities.GetActivityPriorities(True))
cDropDownlist.DisplayMember = "Name" // Current culture handled here !!
// Save the selected priority level from the custom dropdown.
Me.Activity.Priority = DirectCast(cControl, Durkin.Common.Classes.CustomControls.DropDownListDurkin).SelectedItem
Hope this helps.
-- Jim Durkin
02-02-2010 05:19 PM
J,
Thanx for the info. Unfortunately that won't work on my case. I am developing an application that will take an Outlook Calendar item and put it into ACT! and set the priority in ACT! (the Outlook activities' priorities are 0, 1, 2 for low, medium, high). In the past I could just map these numbers to presets in ACT!. However, now it has been a real pain to find a common ground on the priorities side. The solution with High, Medium, Low may work in the US, but it won't anywhere else where English is not spoken. How does ACT! handle this? If the priorities values are not fixed, that means that anything driven of the pririties list has to be custom programmed and requires a custom setup for each install (which of course causes a plethora of bugs).
Thanx for all the info.
T
02-02-2010 05:39 PM
02-02-2010 05:42 PM
Thanx. I'll give that a try.
T
04-02-2015 01:54 AM
I'm Baaack....
The methodology:
Me.Activity.Priority = Me.HostFramework.Activities.GetActivityPriority("High")
works if you are setting the priority on an activitytemplate. However, if you want to change the activity priority on an existing activity, you get a System.NullReferenceException error.
Anybody know what I'm doing wrong?
T
04-02-2015 01:59 AM
Try using the StandardActivityPriority enum since "High" is a std one.
04-02-2015 02:08 AM
What I'm doing is quite straight forward:
Dim MyActivityPriority As Act.Framework.Activities.StandardActivityPriority
MyActivityPriority = ACTFM.Activities.GetActivityPriority(1) ' Medium priority
ACTAppointmentObject.Priority = MyActivityPriority
The code above results on a NullReference error and the priority is not set. Any suggestion for a different type of code?
Thanx in advance.
T