A
Andrew
This one is a real mystery...i bet the answer is going to
be either real simple or real complex!
I have a function which creates a task item and returns
it.
The caller function (a toolbar function) takes the task,
assigns it and sends it.
On the receiving end, I get the message "This task was
delegated to more than one person. Updates will not be
tracked."
I have NO idea why I am getting this, the task is only
ever sent to 1 recipient!!!
See code below.
Anyone that could help me on this would be branded a
legend for EVER! It is SOO irritating not getting
updates on assigned tasks ... defeats the purpose of
using Outlook!
--------------------------------------------------------
Function Toolbar_ExportAsTaskAssignmentInOutlook()
Dim newTask As TaskItem
Set newTask = ExportPLMSTaskToOutlook(Me.CTitemId)
newTask.Assign
newTask.Recipients.Add GetSystemSetting
(Me.Caption, "Send Tasks to Self - Recipient Address")
newTask.Send
End Function
--------------------------------------------------------
Function ExportPLMSTaskToOutlook(CTitemId As Integer,
Optional parentName As String, Optional parentsParentName
As String)
Dim OutlookApplication As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
sql = "select CurrentTasks.*,PGitemTitle from
CurrentTasks,PersonalGoals where
CurrentTasks.PGitemId=PersonalGoals.PGitemId and
CurrentTasks.CTitemId=" + Trim(Str(CTitemId))
Dim PLMSTask As ADODB.Recordset
Set PLMSTask = GetData(sql)
If PLMSTask.RecordCount > 0 Then
Set ExistingTask = GetOutlookTaskForPLMSTask(CTitemId)
If TypeName(ExistingTask) <> "Nothing" Then
Set OutlookTask = ExistingTask
Else
Set OutlookApplication = CreateObject
("Outlook.Application")
Set OutlookTask = OutlookApplication.CreateItem
(olTaskItem)
End If
With OutlookTask
.ItemProperties.Add "CTitemId", olText, False
.ItemProperties("CTitemId").Value = PLMSTask
("CTitemId")
.ItemProperties.Add "PLMS Goal", olText, True
.ItemProperties("PLMS Goal").Value = PLMSTask
("PGitemTitle")
If Not IsNull(PLMSTask("CTitemParent")) Then
.ItemProperties.Add "PLMS Task Level 2", olText,
True
.ItemProperties("PLMS Task Level 2").Value = _
IIf(parentName = "", GetParentNameForTask
(GetParentIdForTask(PLMSTask("CTitemParent"))),
parentName)
End If
If Not IsNull(PLMSTask("CTitemParent")) Then
.ItemProperties.Add "PLMS Task Level 1", olText,
True
.ItemProperties("PLMS Task Level 1").Value = _
IIf(parentName = "", GetParentNameForTask
(GetParentIdForTask(PLMSTask("CTitemParent"))),
parentParentName)
End If
.Subject = PLMSTask("CTitemName")
If Not IsNull(PLMSTask("CTitemBody")) Then
.Body = PLMSTask("CTitemBody")
End If
If Not IsNull(PLMSTask("CTitemStartDate")) Then
.StartDate = DateValue(PLMSTask("CTitemStartDate"))
End If
.DueDate = PLMSTask("CTitemDueDate")
' This may be annoying so may need to become an option
.ReminderSet = True
Select Case PLMSTask("CTitemStatus")
Case "Not Started"
.Status = olTaskNotStarted
Case "In Progress"
.Status = olTaskInProgress
Case "Waiting"
.Status = olTaskWaiting
Case "Aborted"
.Status = olTaskDeferred
Case "Complete"
.Status = olTaskComplete
End Select
Select Case PLMSTask("CTitemPriority")
Case "Very Low"
.Importance = olImportanceLow
Case "Low"
.Importance = olImportanceLow
Case "Medium"
.Importance = olImportanceNormal
Case "High"
.Importance = olImportanceHigh
Case "Very High"
.Importance = olImportanceHigh
End Select
.PercentComplete = PLMSTask("CTitemPercentComplete")
If Not IsNull(PLMSTask("CTitemDateCompleted")) Then
.DateCompleted = PLMSTask("CTitemDateCompleted")
End If
If Not IsNull(PLMSTask("CTitemActualWork")) Then
.ActualWork = PLMSTask("CTitemActualWork")
End If
If Not IsNull(PLMSTask("CTitemEstimatedWork")) Then
.TotalWork = PLMSTask("CTitemEstimatedWork")
End If
End With
ReportEvent ReportToStatusBar, "Exported PLMS task to
Outlook : [" + Trim(Str(CTitemId)) + "] '" + Left(PLMSTask
("CTitemName"), 10) + "...'"
Set OutlookApplication = Nothing
PLMSTask.Close
Set PLMSTask = Nothing
Else
ReportEvent ReportToUser, "ERROR: PLMS Task Id of
this task (" + Trim(Str(CTitemId)) + ") was not found in
the PLMS database!"
End If
Set ExportPLMSTaskToOutlook = OutlookTask
End Function
be either real simple or real complex!
I have a function which creates a task item and returns
it.
The caller function (a toolbar function) takes the task,
assigns it and sends it.
On the receiving end, I get the message "This task was
delegated to more than one person. Updates will not be
tracked."
I have NO idea why I am getting this, the task is only
ever sent to 1 recipient!!!
See code below.
Anyone that could help me on this would be branded a
legend for EVER! It is SOO irritating not getting
updates on assigned tasks ... defeats the purpose of
using Outlook!
--------------------------------------------------------
Function Toolbar_ExportAsTaskAssignmentInOutlook()
Dim newTask As TaskItem
Set newTask = ExportPLMSTaskToOutlook(Me.CTitemId)
newTask.Assign
newTask.Recipients.Add GetSystemSetting
(Me.Caption, "Send Tasks to Self - Recipient Address")
newTask.Send
End Function
--------------------------------------------------------
Function ExportPLMSTaskToOutlook(CTitemId As Integer,
Optional parentName As String, Optional parentsParentName
As String)
Dim OutlookApplication As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
sql = "select CurrentTasks.*,PGitemTitle from
CurrentTasks,PersonalGoals where
CurrentTasks.PGitemId=PersonalGoals.PGitemId and
CurrentTasks.CTitemId=" + Trim(Str(CTitemId))
Dim PLMSTask As ADODB.Recordset
Set PLMSTask = GetData(sql)
If PLMSTask.RecordCount > 0 Then
Set ExistingTask = GetOutlookTaskForPLMSTask(CTitemId)
If TypeName(ExistingTask) <> "Nothing" Then
Set OutlookTask = ExistingTask
Else
Set OutlookApplication = CreateObject
("Outlook.Application")
Set OutlookTask = OutlookApplication.CreateItem
(olTaskItem)
End If
With OutlookTask
.ItemProperties.Add "CTitemId", olText, False
.ItemProperties("CTitemId").Value = PLMSTask
("CTitemId")
.ItemProperties.Add "PLMS Goal", olText, True
.ItemProperties("PLMS Goal").Value = PLMSTask
("PGitemTitle")
If Not IsNull(PLMSTask("CTitemParent")) Then
.ItemProperties.Add "PLMS Task Level 2", olText,
True
.ItemProperties("PLMS Task Level 2").Value = _
IIf(parentName = "", GetParentNameForTask
(GetParentIdForTask(PLMSTask("CTitemParent"))),
parentName)
End If
If Not IsNull(PLMSTask("CTitemParent")) Then
.ItemProperties.Add "PLMS Task Level 1", olText,
True
.ItemProperties("PLMS Task Level 1").Value = _
IIf(parentName = "", GetParentNameForTask
(GetParentIdForTask(PLMSTask("CTitemParent"))),
parentParentName)
End If
.Subject = PLMSTask("CTitemName")
If Not IsNull(PLMSTask("CTitemBody")) Then
.Body = PLMSTask("CTitemBody")
End If
If Not IsNull(PLMSTask("CTitemStartDate")) Then
.StartDate = DateValue(PLMSTask("CTitemStartDate"))
End If
.DueDate = PLMSTask("CTitemDueDate")
' This may be annoying so may need to become an option
.ReminderSet = True
Select Case PLMSTask("CTitemStatus")
Case "Not Started"
.Status = olTaskNotStarted
Case "In Progress"
.Status = olTaskInProgress
Case "Waiting"
.Status = olTaskWaiting
Case "Aborted"
.Status = olTaskDeferred
Case "Complete"
.Status = olTaskComplete
End Select
Select Case PLMSTask("CTitemPriority")
Case "Very Low"
.Importance = olImportanceLow
Case "Low"
.Importance = olImportanceLow
Case "Medium"
.Importance = olImportanceNormal
Case "High"
.Importance = olImportanceHigh
Case "Very High"
.Importance = olImportanceHigh
End Select
.PercentComplete = PLMSTask("CTitemPercentComplete")
If Not IsNull(PLMSTask("CTitemDateCompleted")) Then
.DateCompleted = PLMSTask("CTitemDateCompleted")
End If
If Not IsNull(PLMSTask("CTitemActualWork")) Then
.ActualWork = PLMSTask("CTitemActualWork")
End If
If Not IsNull(PLMSTask("CTitemEstimatedWork")) Then
.TotalWork = PLMSTask("CTitemEstimatedWork")
End If
End With
ReportEvent ReportToStatusBar, "Exported PLMS task to
Outlook : [" + Trim(Str(CTitemId)) + "] '" + Left(PLMSTask
("CTitemName"), 10) + "...'"
Set OutlookApplication = Nothing
PLMSTask.Close
Set PLMSTask = Nothing
Else
ReportEvent ReportToUser, "ERROR: PLMS Task Id of
this task (" + Trim(Str(CTitemId)) + ") was not found in
the PLMS database!"
End If
Set ExportPLMSTaskToOutlook = OutlookTask
End Function