how to Implement custom share functionality in SharePoint 2013 To share an article via email programmatically?

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/132902

  •  02-10-2020
  •  | 
  •  

Question

Client Says That users will have the ability to share an article via email. This will take the form of an icon on the page that will have the same effect as the “share link” OOTB functionality.

Is It Possible?

Was it helpful?

Solution

First I tried to search on the blogs but I didn’t find anything related to programmatic-ally ,Then I find the function "DisplaySharingDialog (webUrl, listId, listItemId)" that is used to open the dialog box for sharing users.

    function SharePage()
    {
        EnsureScriptFunc('sharing.js', 'DisplaySharingDialog', 
            function () {
            DisplaySharingDialog(_spPageContextInfo.webAbsoluteUrl, _spPageContextInfo.pageListId, _spPageContextInfo.pageItemId.toString());
                    }
                    );
    }

Since this function is defined in Sharing.js file that why we are trying to ensure that Sharing.js is already loaded before calling DisplaySharingDialog function.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top