【问题标题】:get all employee anniversary for the current month from user profile + SP2013从用户资料 + SP2013 获取当月的所有员工周年纪念日
【发布时间】:2018-02-14 01:06:50
【问题描述】:

我在 Sp2013 中有一个前提条件。我需要为当月的所有员工提取周年纪念日。 我有为当前用户提取数据的代码。我需要所有周年纪念日属于当月的用户的帮助。任何帮助表示赞赏。

var url = _spPageContextInfo.siteAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties"; 

$.ajax({  

    url: url,
    type: "GET",

    contentType: "application/json;odata=nometadata",  
    headers: { Accept: "application/json;odata=verbose" },  
    success: function (data) {  
        try {  
            //Get properties from user profile Json response  
            userDisplayName = data.d.DisplayName;  
            AccountName = data.d.AccountName;

【问题讨论】:

标签: rest sharepoint sharepoint-2013 user-profile sharepoint-userprofile


【解决方案1】:

CSOM 将为每个用户提供方法。因此,在您的情况下,如果您想获取每个用户的周年纪念日,那么您需要首先获取网站集中可用的所有用户,然后遍历它们以获取它的用户配置文件并获取周年纪念字段。 @vaibhav 建议有一个如何实现的示例。

寻找投票最多的答案

谢谢

【讨论】:

    【解决方案2】:

    您需要使用 Refiner 属性,例如日期或字符串。并使用 rest search api 调用。

    1. 根据自定义或 Sharepoint OOB 属性映射 People:BirthDate 或 SPS-Birthday。
    2. 周年纪念有与之相关的年份。但是生日有日期月份没有年份。
    3. 相应地应用过滤器以获得相关结果。 请参阅以下示例: https://joranmarkx.wordpress.com/2013/10/02/show-upcomming-birthdays-based-on-sharepoint-2013-user-profiles-with-search-office365/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多