Reputation: 363
I have a requirement in Sp2013 on premise. I need to pull Anniversary for all the employee for the current month. I have code that pull data for the current user. I need help for all the users, who anniversary belong to current month. Any help is appreciated.
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;
Upvotes: 0
Views: 1285
Reputation: 103
You need to use a Refiner property like date or string. And go with rest search api call.
Upvotes: 0
Reputation: 2664
CSOM will provides method for the Per user. So in your case if you want to get the anniversary of each user then you need to first get all the users available in a site collection and then iterate through them to get the user profile of it and get the anniversary field. @vaibhav suggested there is an example of how to implement this.
Look for the most upvoted answer
Thanks
Upvotes: 1