B
Bill
For a given task, through MSP API we create task assignment and assign work
hours. We found out that subsequent task assignment will take up work hours
of a previous one even if we do not explicitly assign any work hours if the
work hour is 0.
But any assignment without explicitly assigning hours that precede the
assignment with work hours greater than 0 will show work hours 0, in other
words, previous assignment without any work hour assigned will show 0 work
hours.
All our task are of fixed duration.
Can anyone tell us how can this be resolved that if no work hours to
assignment is made, the work hours will retain 0 ?
assignments in our application assignment in MSP
ass1 work 0 hours ass1 work 0
hours
ass2 work 3 hours ass2 work 3
hours
ass3 work 0 hours ass3 work 3
hours
ass4 work 0 hours ass4 work 3
hours
Sample code below:
For Each xnAssignmentNode In xnlAssignmentList
'create assignment object
MSPAssignment = MSPTask.Assignments.Add(ResourceID:=intMSPResourceUID)
'set start date and finish date here
tempNode = xnAssignmentNode.SelectSingleNode("Work")
If Not (tempNode Is Nothing) Then
TempVal = Convert.ToDecimal(tempNode.InnerText.Trim,
System.Globalization.CultureInfo.InvariantCulture) * 60
If (MSPAssignment.Work <> TempVal) And (TempVal <> 0) Then
MSPAssignment.Work = TempVal
End If
End If
'We do not explicitly assign 0.0 hours to work property because that
could trigger MSP recalculate start and finish date.
next
hours. We found out that subsequent task assignment will take up work hours
of a previous one even if we do not explicitly assign any work hours if the
work hour is 0.
But any assignment without explicitly assigning hours that precede the
assignment with work hours greater than 0 will show work hours 0, in other
words, previous assignment without any work hour assigned will show 0 work
hours.
All our task are of fixed duration.
Can anyone tell us how can this be resolved that if no work hours to
assignment is made, the work hours will retain 0 ?
assignments in our application assignment in MSP
ass1 work 0 hours ass1 work 0
hours
ass2 work 3 hours ass2 work 3
hours
ass3 work 0 hours ass3 work 3
hours
ass4 work 0 hours ass4 work 3
hours
Sample code below:
For Each xnAssignmentNode In xnlAssignmentList
'create assignment object
MSPAssignment = MSPTask.Assignments.Add(ResourceID:=intMSPResourceUID)
'set start date and finish date here
tempNode = xnAssignmentNode.SelectSingleNode("Work")
If Not (tempNode Is Nothing) Then
TempVal = Convert.ToDecimal(tempNode.InnerText.Trim,
System.Globalization.CultureInfo.InvariantCulture) * 60
If (MSPAssignment.Work <> TempVal) And (TempVal <> 0) Then
MSPAssignment.Work = TempVal
End If
End If
'We do not explicitly assign 0.0 hours to work property because that
could trigger MSP recalculate start and finish date.
next