Hi Marc,
Thank you for the help! I think I'm getting there, but I am a bit of a novice programmer and am receiving results that are not just for one user. Do you see anything (or several things) in the code below that look ill-advised?
Thanks again!
Thank you for the help! I think I'm getting there, but I am a bit of a novice programmer and am receiving results that are not just for one user. Do you see anything (or several things) in the code below that look ill-advised?
Thanks again!
function getMyTasks() {
// Get Current User
var myUserName= $().SPServices.SPGetCurrentUser({
fieldName: "UserName"
});
//alert(myUserName)
// Create Search for Tasks
var queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>"
queryText += "<Query>"
queryText += "<Context>"
queryText += "<QueryText language='en-US' type='STRING'>"
queryText += "ContentClass:\"STS_Site\" ContentClass:\"STS_ListItem_Tasks AssignedTo:" + myUserName + "*\"";
queryText += "</QueryText>"
queryText += "</Context>"
queryText += "</Query>"
queryText += "</QueryPacket>";
$().SPServices({
operation: "Query",
queryXml: queryText,
completefunc: function (xData, Status) {
alert("Status: " + Status);
$(xData.responseXML).find("QueryResult").each(function() {
// What are my results?
$("#myTasksTemp").append($(this).text());
}); // End xData response
} // End completefunc
}); // End SPServices
} // End Function
getMyTasks();