Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts

Friday, October 16, 2015

SharePoint REST calls on Users Profile

I have provided some useful REST calls on the SharePoint user profile in this blog post, I hope these calls may help someone. 

Note: Replace "siteurl" with your site url.

For more REST calls on user profiles, check this User profiles REST API reference

Calls Related to User Profile:

1    1. Get people followed by you:

2    2. Get people you are following:

3    3. To get current user profile properties:

      4. To get properties of specific user:
https://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v=’i:0%23.f|membership|test@onlinemicrosoft.com’

      5. To get all employees in user profile:

      6.  Search employees by department :
 https://siteurl/_api/search/query?querytext=’Department:IT*’&sourceid=’b09a7990-05ea-4af9-81ef-edfab16c4e31’&selectproperties=’LastName,FirstName,WorkEmail,JobTitle,PictureUrl,PreferredName,Department,AccountName’

Example Ajax calls:

GET:

$.ajax({
            url: provideUrlHere,
            method: "GET",
            headers: { "Accept": "application/json; odata=verbose" },
            cache: false,
            async: false,
            success: function (data) {
                //Do some thing with response data
            },
            error: function (data) {
               // Request didn't succeed 
            }
        });

POST

S$.ajax({
            url: provideUrlHere,
            type: "POST",
            contentType: "application/json;odata=verbose",
            data: data,
            headers: {
                "Accept": "application/json;odata=verbose",
                "X-RequestDigest": S$("#__REQUESTDIGEST").val()
            },
           success: function (data) {
                //Do some thing with response data
            },
            error: function (data) {
               // Request didn't succeed 
            }
        });

Tuesday, October 28, 2014

Column ‘HtmlDesignAssociated’ does not exist. It may have been deleted by another user.


Issue: Column 'HtmlDesignAssociated' does not exist. It may have been deleted by another user.  /xxxxxxx/xxxx. Undefined.

When you are trying to convert html page to masterpage form SharePoint 2013 design manager ,this error may occur due to following reasons.

The Causes of the Issue:

1) The publishing feature is not activated properly in site collection level or web level.

2)The Html file is not available in “/_catalogs/masterpage”. I.e. you are trying to insert the html file for the conversation process from another location except /_catalogs/masterpage”.

Solution:

1) Activate the publishing feature at site collection level and site level. If it is already activated make sure it was activated properly.

2) Upload your html file into /_catalogs/masterpage” location and try the conversation process again, because “HtmlDesignAssociated” column is not available for all document libraries.

Sunday, October 26, 2014

Retention Policy on a document library in SharePoint 2013



The following steps will explain how to enable Retention policy on a document library.

      1) Select the document library, to which you want to apply Retention Policy.

      2) Go to Library Settings of the selected document library. 

    3) Click on "Information Management Policy Settings" link present under Permissions and Management category.      


  
     4) Check the “Enable Retention” checkbox and Click on OK.



      5)  The following window will appear, by default the retention policy was applied on content types. So we need to change the retention policy to document library.  To achieve this click on “Change source or configure library schedule” link which is highlighted in the below screenshot.






6)  Select "Library and Folders" radio button and provide description. 




      7)  Under the description field "Add retention stage.." link is available. Click on that link.
  
      8) The following pop up will be opened.In this step we need to configure the retention policy conditions i.e; what causes the stage to activate and also specify the action when the stage is triggered.







     9)  Click on Ok to apply the retention policy on document library.




 10) If we want to generate a report for this retention policy click on the "Generate a File Plan Report for this library" link present on the above screenshot and  save this file in particular location in your site, and open this with Excel.

This file contains the information about Retention Policy as follow.





    Total Pageviews