Skip to main content
Goal:
Create a new Task on a Sharepoint site

Setup:
Using the Sharepoint 2003 List Event Wizard and I am able to create a Sharepoint Task.

Problem:
I can create the task okay, but I cannot get the "Assigned To" to work.

I investigated the code
'====>
' ---- Assigned To ----

' Get User Id
SpsList.GetUserId(Site, Field(4), TempInt, "")
Field(4) = CType(TempInt,String)

oXmlElement = oXmlDoc.CreateNode _
(System.Xml.XmlNodeType.Element, "ListItem", "")
oXmlElement.Attributes.Append(oXmlDoc.CreateNode _
(System.Xml.XmlNodeType.Attribute, "Name", ""))
oXmlElement.Attributes("Name").Value = "Assigned To"

oXmlElement.Attributes.Append(oXmlDoc.CreateNode _
(System.Xml.XmlNodeType.Attribute, "Description", ""))
oXmlElement.InnerText = Field(4)
oXmlDoc.DocumentElement.AppendChild(oXmlElement)
'<====

And tried to 3 different ways to initialize Field(4) - i.e. the var used in SpsList.GetUserId(...). In each case it is the same user (myself) and I have verifed that user has access to the Sharepoint site (and could be 'normally' assigned) to a Task:

1) Field(4) = K2.ActivityInstanceDestination.User.ToString()
2) Field(4) = szDomain & "" & _
K2.ActivityInstanceDestination.User.ToString()
3) Field(4) = "Al Smyth"
4) Field(4) = szDomain & "al.smyth"

Each time it creates the task okay - but the "Assigned To" is blank.
Be the first to reply!

Reply