Sharepoint RestAPI [英] Sharepoint RestAPI
问题描述
Dear All,
  我正在从共享点列表中显示CEO消息。现在我想像这样增强 当
CEO消息被更改时,它应该向用户显示一些通知在用户看到该消息之前,这是一条新消息。下面是我的旧代码。请通过编码告诉我。
函数GetCEOData(){
$ .ajax({
url:_spPageContextInfo.webAbsoluteUrl +" / _ api / web / lists / getByTitle('CEO')/ items?$ select = Title,Image,Description",
type:" GET",
headers:{
" accept":" application / json; odata = verbose",
" content-type":" application / json; odata = verbose",
},
success:onQuerySuccessceo,
错误:onQueryFailceo
});
}
function onQuerySuccessceo(data){
if(data.d.results.length> 0){
console.log(data.d.results);
var a = data.d.results;
$ .each(data.d.results,function(key,value){
$(" .ceo-image") .html('< img src ='+ value.Image.Url +'>');
$(&#; ceomess")。html(''+ value.Description +'< / div>' )
});
}
}
function onQueryFailceo(){
alert('抱歉发生错误!');
}
问候,
Mohamed
JavaScript无法监视SharePoint列表项更改,监视列表项更改,需要创建事件接收器或远程事件
接收器。
事件接收者:你需要创建农场解决方案。
创建事件接收器演示。
https://www.c-sharpcorner.com/article/介绍共享点事件接收器/
在事件接收器中发送电子邮件。
远程事件接收器:您需要创建SharePoint提供程序托管的加载项。
https://www.c-sharpcorner.com/article/ sharepoint-2013-remote-event-receivers /
通过MailMessage发送电子邮件。
https://www.codeproject .com / Articles / 879538 /如何发送电子邮件在SharePoint-Provider-Hosted-Ap
最好的问候,
利跨度>
Dear All,
I am showing CEO message from share point list. Now i want to enhance like these when CEO Message is changed it should show some notification to user that it’s a new message until user has seen the message. Below is my older code.Kindly let me know with coding.
function GetCEOData(){
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('CEO')/items?$select=Title,Image,Description",
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
},
success: onQuerySuccessceo,
error: onQueryFailceo
});
}
function onQuerySuccessceo(data){
if(data.d.results.length>0){
console.log(data.d.results);
var a=data.d.results;
$.each(data.d.results, function (key, value) {
$(".ceo-image").html('<img src='+value.Image.Url+'>');
$("#ceomess").html(''+value.Description+ '</div>')
});
}
}
function onQueryFailceo() {
alert('Sorry An Error Has Occurred!');
}
Regards,
Mohamed
Hi,
JavaScript can’t monitor SharePoint list item change, to monitor list item change, you need create event receiver or remote event receiver.
Event receiver: you need create farm solution.
Create event receiver demo.
https://www.c-sharpcorner.com/article/introduction-of-sharepoint-event-receivers/
Send email in event receiver.
Remote event receiver: you need create SharePoint provider-hosted add-in.
https://www.c-sharpcorner.com/article/sharepoint-2013-remote-event-receivers/
Send email by MailMessage.
https://www.codeproject.com/Articles/879538/How-to-Send-Email-in-SharePoint-Provider-Hosted-Ap
Or, create a workflow to monitor item change and send email.
Best Regards,
Lee
这篇关于Sharepoint RestAPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!