Aug 19, 2016

Simple Workaround for Content Editor Webpart in Another Site Collection

Guess what? You have created a HTML script stored somewhere in SharePoint, and you want to use it somewhere in another Site Collection. But you are stuck with this error, “Cannot retrieve the URL specified in the Content Link property. For more assistance, contact your site administrator”.


There are a few workarounds you can try.

Using Page Viewer or IFRAME

To use the page viewer, the solution is quite straight-forward and can be described in a few sentences.

Firstly, you know that you have created the HTML script, now create a page in the same Site Collection, then add Content Editor Webpart that links to the HTML script.

Then you can go to the other Site Collection, create a page with Page Viewer, or direct HTML with IFRAME which links to the page created in previous step. Remember, the SharePoint top links bar and left navigation will still be displayed. To overcome that, you can add query string “IsDlg=1” at the end of the URL.

If your URL is like:, then it should be like

Using jQuery

If your masterpage is attached with jQuery, you can re-use the following code.

<div class="pp-container">
<script type="text/javascript">
  url: "/SiteAssets/common/thescripts.txt",
  method: "GET",
  success: function (data) {
  error: function (data) {

Where "/SiteAssets/common/thescripts.txt" is the URL of your HTML script.

Aug 8, 2016

Tips: Open Office Document Online (Web Version) in SharePoint

In SharePoint, there are 2 ways of setting a link to an Office Document. The most common way we’ve always seen is by direct link, which will download the Office document to your local storage.

Now, there’s another way to link to an Office document and force it to open in Online viewer such as Excel Online, PowerPoint Online, or Word Online. The most possible way is to copy the URL by clicking on the ellipsis next to the filename.


Now, you’ll see something similar to this, which will force-open the file in Excel Online:

Or at any point of time if you know the direct URL to the file but unsure what is the number or code next to d=, you can just put the link as below.

This way, it will forcefully open the excel (or essentially any Office document) in Online Viewer.


WAIT, there’s more! I know that you’re going to complain!

Jul 27, 2016

Using jQuery to Send Email from SharePoint

I’ve been outside of this blog so far and never post anything in this blog. But let me share a small code snippet that can be used. Below is the code to send email from SharePoint.

var EmailInfo = {
  To : { Address : '' },
  Subject : 'This is the subject',
  Body : 'This is the <b>Body</b>'

 url: _spPageContextInfo.webServerRelativeUrl +
 contentType: 'application/json',
 type: "POST",
 headers: {
  "Accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose",
  "X-RequestDigest": $("#__REQUESTDIGEST").val()
 data: JSON.stringify({
  'properties': {
   '__metadata': { 'type': 'SP.Utilities.EmailProperties' },
   'From': 'Radityo Ardi',
   'To': { 'results': [EmailInfo.To.Address] },
   'CC': [],
   'Subject': EmailInfo.Subject,
   'Body': EmailInfo.Body
 success: function(dataSendEmail) {
  alert('Email successfully sent.');
 error: function(err) {