function getListData(ListId)
{
$().SPServices(
{
operation: "GetListItems",
async: false,
listName: "NodueFormList",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID'/><Value Type='Text'>" + ListId + "</Value></Eq></Where></Query>",
completefunc: function (xData, Status)
{
var SeparationCount = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
if (SeparationCount > 0)
{
$(xData.responseXML).SPFilterNode("z:row").each(function () {
if ($(this).attr("ows_Admin") != undefined) {
AdminId = $(this).attr("ows_Admin").split(';')[0];
}
if ($(this).attr("ows_HR") != undefined) {
hrId = $(this).attr("ows_HR").split(';')[0];
}
});
}
}
});
}
function UpdateData(ListId)
{
var adminaddtional = document.getElementById("txtareaAdition").value;
siteUrl = "/sites/Empower/";
var listName = "NodueFormList";
var itemType = GetItemTypeFoListName(listName);
var item =
{
__metadata: { "type": itemType },
};
$.extend(item, { PendingwithId: hrId });
//Multiple people picker update IsVisible is column name and Id add
$.extend(item, { IsVisibleId:{'results':[AdminId,hrId]}}**);
$.extend(item, { Flag: "0" });
$.extend(item, { Additonalnotetoadmin: adminaddtional });
$.extend(item, { Role: "HR" });
$.extend(item, { IsActive: "Yes" });
$.ajax(
{
url: siteUrl + "_api/Web/Lists/GetByTitle('" + listName + "')/GetItemById('" + ListId + "')",
type: "POST",
async: false,
contentType: "application/json;odata=verbose",
data: JSON.stringify(item),
headers: {
"accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"X-RequestDigest": jQuery("#__REQUESTDIGEST").val(),
"IF-MATCH": "*",
"X-Http-Method": "MERGE"
},`enter code here`
success: function (data)
{
alert("Updated Successfully");
},
error: function (error)
{
console.log(JSON.stringify(error));
}
});
}