Access Office 365 using a Console Application

Create the Security Principal

Navigate to your Office 365 tenant. This will be of the format https://{your-domain}.sharepoint.com by default.

Open the application page https://{your-domain}.sharepoint.com/_layouts/15/appregnew.aspx
Continue reading “Access Office 365 using a Console Application”

Cross Domain Library in SharePoint 2013

Let’s have a look at the Cross Domain Library in SharePoint 2013

In this series of posts, I will be posting my experience following along to the Microsoft Virtual Academy course on SharePoint Online Development for Office 365.

Let’s see how to use the cross domain library from a provider hosted app.
Continue reading “Cross Domain Library in SharePoint 2013”

Create a list item in another site collection

It is much easier to create or update a list item in another site collection using JSOM. We can easily do it as follows:

I recommend using this method instead of the REST API to create a list item in another site collection.

var listName;
var item;
var itemType;

var otherClientContext = new SP.ClientContext("other site url");
var oList = otherClientContext.get_web().get_lists().getByTitle(listName);
otherClientContext.load(oList);

var itemCreateInfo = new SP.ListItemCreationInformation();
var oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('Title', "SharePoint");
oListItem.update();

own1ClientContext.load(oListItem);
own1ClientContext.executeQueryAsync(onQuerySucceeded, onQueryFailed);

function onQuerySucceeded() {
}

function onQueryFailed(sender, args) {
   alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

Continue reading “Create a list item in another site collection”