Tuesday 25 December 2018

Working with Office365 Project Online Tasks using JSOM - Part II

In this article, let us look at updating or deleting tasks on Office 365 project online using JavaScript Object Model.

This article series focuses on working with office 365 project online plan schedule tasks using JSOM approach. The previous article explains creating or retrieving tasks on project online schedules using JSOM approach.


Update Task on Project Schedule 


To update a task on the project online, the following operations are performed.
  • Check-out a project – This operation involves get project by GUID and check-out. (If already checked out, this step is not required) 
  • Update task (OOB/custom fields can be updated) - This operation involves steps like get project by GUID, then get the project draft, get the task collection from the project draft, get task using task GUID, set necessary fields (OOB or custom) with values and updating project draft. 
  • Publish & check-in the project. - This operation involves get project by GUID, get the project draft, publish/check-in the project. (If other actions are involved, this step is not required)

Saturday 22 December 2018

Working with Office365 Project Online Tasks using JSOM - Part I

This article series focuses on working with office 365 project online plan schedule tasks using JSOM approach. The operations like create, retrieve, update or delete project task operations are explained.

Here in this article, let us look at creating or retrieving project schedule tasks using JSOM approach. 

Office 365 Microsoft Project Online helps creating project plans, managing schedules and collaborating with other resources virtually. Project plans, task schedules and other objects on the Microsoft Project online can be accessed or created or updated programmatically. Microsoft documentation site  provides REST endpoints for working with project online objects. 


Load prerequisite files and context: 


To get the project server context working, first let us see the prerequisite files to be loaded for getting the project online contexts. The following piece of code shows how the required Project Server/SharePoint files and contexts (PS/SP) are loaded. 


Monday 10 December 2018

Accessing Office 365 Project Web App Objects using REST API

This article describes accessing the objects present on the Office 365 project web app site collection using REST API.

PWA abbreviated as Project Web App, is available on Office 365, and it used for easily and efficiently planning projects, track status, and collaborate with other virtually. It is an application built on top of SharePoint, which has collaborating features. Any PWA site collection will have the project web app settings feature enabled on the site collection. To know more about PWA, refer to the official documentation available on the MSDN site.

Let us see the high level REST API (service end points), which can be used for accessing objects available on Office 365 PWA site collections.

Note: Replace the Office 365 PWA url with your respective URL.

To access the project server and list of available objects,
https://nakkeerann.sharepoint.com/sites/pwa/_api/ProjectServer

The REST APIs used for accessing objects available on the project servers are explained below.


Custom Fields:

The enterprise custom fields are created on the project plans for managing additional project attributes. The custom field can be at project or task level. The following API is used to access all the enterprise custom fields.
https://nakkeerann.sharepoint.com/sites/pwa/_api/ProjectServer/CustomFields

One specific field can be accessed using the field GUID:
https://nakkeerann.sharepoint.com/sites/pwa/_api/ProjectServer/CustomFields('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')

Wednesday 28 November 2018

Serverless Azure WebJobs - Triggers to Push Data from Azure Storage into Office 365 SharePoint

Let us look how we can leverage the power of azure cloud storage, and integrate data into Office 365 SharePoint. In this article, we will use serverless WebJobs to push the data into Office 365 SharePoint online, whenever new content is added to storage systems like queues and blobs.

Scenario: Azure cloud storage system is used as centralized platform for storing/publishing the content. Office 365 SharePoint to get the content, whenever the data is available on the cloud storage.

Azure webjobs can be used for pushing the data to SharePoint systems/applications. We will be using Azure Webjob SDK framework, which has necessary triggers for queues and blobs, to trigger the content whenever it is available. We will be using OfficeDevPnp core libraries on Azure webjobs to integrate the data into Office 365 SharePoint.

This article explains trigger events for both queue and blob, present on Azure storage. But based on your requirement, you can select any of the storage.

The prerequisites required are,
  • Office 365 SharePoint
  • Azure Storage Account –  
    • Queues 
    • Blobs 
  • Azure App Service which has WebJobs 
  • Microsoft Visual Studio – This is optional, and you can use any other alternative approach. But in this case, I have used visual studio to build the solution and to deploy the solution directly to cloud. 

Friday 9 November 2018

Azure Functions with Office 365 SharePoint Calls - Creating, Debugging & Deploying NodeJS Functions using Visual Code - Part II

Here let us look at the debugging the azure function locally and deploying the function to the portal.

In the previous article, we have seen creating the Azure function and accessing the SharePoint data using NodeJS.

Since we are calling SharePoint authentication methods and SharePoint list APIs, we need to make sure that the function is not returning the response to client, before executing the authentication and rest API calls. This can be done using async and await keywords. By default, outer module function has the async function. In the azure function code, we need to append the await keyword for the calling code and async to the function present in the code.

async and await on the azure function code
async and await on the azure function code

Note:
The code available in the previous article doesnt have these keywords, i have left it to you for embedding for hands-on.