Monday 3 April 2017

SharePoint Online/ SharePoint 2013 - Calling Sync Function Through Javascript


Sharepoint enables users to take the document library offline and sync the documents on personal devices leveraging OneDrive for Business feature

  1. Sync option is available in Sharepoint Online as well Sharepoint 2013 on premise (Provided we have Onedrive installed on our local machine
  2. In case we have customized our masterpage and we are not using  OOB document library views we can’t use sync feature
  3. In this scenario we need to hook some client script to call the sync functionality on custom event.
  4. To call the sync functionality on click of control/using javascript below method can be used 

EnsureScriptFunc('offline.js', 'TakeOfflineToClientReal', function() { TakeOfflineToClientReal(2, 1, 'https://mydomain.sharepoint.com/sites/sc/webname', 1, 101,'989F78C3-FB40-46DE-ABF5-60380B44D201', '');});

989F78C3-FB40-46DE-ABF5-60380B44D201 – Is the GUID of the document library

No comments:

Query List/Document Library in Specific Folder

To query SharePoint List or Document Library in specific Folder “ FolderServerRelativeUrl ” as part of the CAML Query Code Snippet ...