Community
Showing results for 
Search instead for 
Do you mean 
Reply

Setting an Activity's Priority

Astute Commentator
Posts: 168
Country: United States

Setting an Activity's Priority

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

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Setting an Activity's Priority

T,

This is untested code but wouldn't it be something like this:

 

Me.Activity.Priority = Me.HostFramework.Activities.GetActivityPriority("High")

 

 

-- Jim Durkin

Astute Commentator
Posts: 168
Country: United States

Re: Setting an Activity's Priority

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

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Setting an Activity's Priority

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 Smiley Happy

 

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 

Astute Commentator
Posts: 168
Country: United States

Re: Setting an Activity's Priority

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

 

 

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Setting an Activity's Priority

 

T,

I  think that ACT will take a integer 1,2,3 for the priority.

 

ACTFM.Activities.GetActivityPriority(1)

 

Hope this helps.

-- Jim Durkin

Astute Commentator
Posts: 168
Country: United States

Re: Setting an Activity's Priority

Thanx. I'll give that a try.

 

T

Astute Commentator
Posts: 168
Country: United States

Re: Setting an Activity's Priority

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

 

Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Setting an Activity's Priority

Try using the StandardActivityPriority enum since "High" is a std one.

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Astute Commentator
Posts: 168
Country: United States

Re: Setting an Activity's Priority

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