【发布时间】:2020-03-01 00:17:01
【问题描述】:
我已被分配从一个弹出窗口(通过 Sharepoint 页面/“仪表板”上的按钮激活)窗口工作,该窗口从 SharePoint 列表中打开一个新表单。这就是弹出窗口的样子。
SharePoint New Form for Event XYZ
注意:促销项目、购买的数量、事件和删除(标志!!!)都使用 SharePoint 新表单进行了修改。这些输入都在 SharePoint 列表中它们自己的列中(从另一个角度来看)。保存项目时,会发生这种情况:
注意:在 SAVE 之后保存/创建玩具项目时,它会保存到另一个 SharePoint 列表以进行记录。
现在,请注意删除按钮。创建玩具项目时,Delete 标志默认为 NO。 目标:我想单击删除按钮并将 Sharepoint 选项值从 NO 更改为 YES。到目前为止,我已经创建了这段代码(它不起作用):
function deleteGuestName(parent, parentID){
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('Toy Order List'); //SP list name
this.oListItem = oList.getItemById(listID);
this.oListItem = oList.set_item("Delete","Yes"); //I thought this would change the choice field
oList.update();
oListItem.deleteObject();
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onQuerySucceeded),
Function.createDelegate(this, this.onQueryFailed)
)
}
function onQuerySucceeded() {
refreshGrid();
parent.closeHSPopup();
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() +
'\n' + args.get_stackTrace());
}
对此的任何帮助表示赞赏。如果需要,我很乐意澄清。 thnxx
【问题讨论】:
标签: javascript sharepoint sharepoint-online web-parts choicefield