Sharepoint RestAPI [英] Sharepoint RestAPI

查看:68
本文介绍了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/介绍共享点事件接收器/


在事件接收器中发送电子邮件。


http://geekswithblogs.net/TanviBlog/archive/2013/06/06/send-mail-from-even-receiver-to-a-user-or-user.aspx


远程事件接收器:您需要创建SharePoint提供程序托管的加载项。


https://www.c-sharpcorner.com/article/ sharepoint-2013-remote-event-receivers /


通过MailMessage发送电子邮件。


https://www.codeproject .com / Articles / 879538 /如何发送电子邮件在SharePoint-Provider-Hosted-Ap



http://mundrisoft.com/tech-bytes/how-to-send-an-email-using-workflow-when-items-are-created-or-updated-in-sharepoint/


最好的问候,



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.

http://geekswithblogs.net/TanviBlog/archive/2013/06/06/send-mail-from-even-receiver-to-a-user-or-user.aspx

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.

http://mundrisoft.com/tech-bytes/how-to-send-an-email-using-workflow-when-items-are-created-or-updated-in-sharepoint/

Best Regards,

Lee


这篇关于Sharepoint RestAPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆