Posts

SharePoint 2013 List CRUD operation using Angular and REST API

Image
This article explains how to perform the CRUD operation on a SharePoint List using Angular JavaScript and the REST API. Create an empty SharePoint 2013 solution, In that add the module of Pages, JS & CSS. In pages module add new item, Test.aspx. In JS module, add new Javascript file with name Controller.js , CommonServices.js &  SharePointListModule.js Other Javascripts needs to add: 1.  angular.min.js 2. anugular.min.js.map Project structure will look something like below: In SharePointListModule.js will create a App of angular, Paste the below code. //App creation var app = angular.module("SharePointAngApp", []) For doing a CRUD operation with SharePoint List, will create an Angular Service to make a SharePoint REST API calls, app.service('testService', ['$http', '$q', function ($http, $q) {//common services}]); This testService having dependency of $http & $q Information related to $http & $q   ...

“Response no longer required” error in nintex workflow

Image
Error:  “Response no longer required” With Nintex , requirement was to create a workflow which passes through multiple approval process. Workflow having Felxi tasks with customized task forms. After publishing everything works well in development environment. Time was to deploy the workflow at test environment, deployed workflow with manual import/export published it no error reported, its published successfully. When first approval task starts, it started giving email notification something like below: "Response no longer required" A task regarding this item no longer requires your response: ItemName Click here to view the workflow status First was not sure, from where this notification coming up from workflow steps, as I haven't set any message like this in workflow,  No error reported in workflow tasks, or in workflow history. Invested almost a whole day to find the exact cause. Finally found in flexi task configuration window under ...

Nintex Forms: Cannot open designer "An error occurred during an ajax call."

Recently I have installed the Nintex Workflow Forms and configured it. I have activated the web application feature and site collection features and all, however when I try to customize a list forms using Nintex designer I started getting error message that says  "An error occurred during an ajax call." When I did IISReset, it seemed to have fixed it. hope this small piece of information will save your time!

Nintex Workflow 2013, unable to publish workflow : soap:serverserver not able to process request object reference not set

Image
Being a newbie with Nintex, I have installed and configured Nintex Workflow and Nintex Workflow Forms. easy to follow all the steps described on Nintex support page. After doing all the necessary configuration, tried to create very simple one step workflow to test. There I faced weird issue, I was able to save the workflow, however while publishing it was giving below error. Error was very generic, wasted couple of hours to find the exact cause as in workflow logic there was nothing. simple one step workflow it was. So pointer was going to configuration only, something in configuration is not proper which throwing this error. Solution : 1. Go to Central Admin 2. Click on Nintex Worklfow Management 3. Database setup -> Add Content Database ( I already configured it, still created new) 4. Configuration Database click Edit 5. Update the connection string with newly created database. 6. IISRESET And we are good to go. Hope this will save you...

How to query SP2013 Managed metadata term store with JSOM

This post will show how to read the Taxonomy Term Store with JSOM. Taxonomy Term store can be accessed in a SharePoint App, with permission scope of Taxonomy. To be able to use the JSOM API for Taxonomy you need to reference SP.Taxonomy.js found in _layouts/15/ the best way to reference this would be in the document ready. $(document).ready(function () { var scripRef = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/"; $.getScript(scripRef+ "SP.Runtime.js", function () { $.getScript(scripRef+ "SP.js", function () { $.getScript(scripRef+ "SP.Taxonomy.js", function () { context = SP.ClientContext.get_current(); //Call your code here. getTermStores(); });});});}) Read from Taxonomy function getTermStores() { session = SP.Taxonomy.TaxonomySession.getTaxonomySession(context); termStores = session.get_termStores(); context.load(session); context.load(termStores); context.execute...

SharePoint Designer 2013 Workflow changes

Image
Already, there are so many articles published about the new features and changes in SharePoint Designer 2013 that it’s a little late to write about this. But I think this would be useful. There are many new functionalities and enhancements added into SharePoint designer 2013. Added features allow designers to do more with workflows without requiring a developer to write custom code. If you select SharePoint 2013 option while creating workflow, you will get the following list of new features 1. Stages With 2013, concept of stage is introduced. It acts as containers in workflow, which allows one to structure the workflow from one stage to the other. Stages can be added to a workflow by clicking on Stage icon. Key points for Stages: All actions in the workflow must be contained in a stage A stage can hold one or more workflow actions, and will also have only one  Transition to stage  area.  The  Transition to st...

Workflow gets canceled automatically with (500) Internal Server Error.

Workflow is getting cancel with the HTTP 500 error.  Problem: RequestorId: 9dea9a29-bb82-214a-0000-000000000000. Details: RequestorId: 9dea9a29-bb82-214a-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 500 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["30"],"SPRequestGuid":["9dea9a29-bb82-214a-92f0-943af4411ac2"],"request-id":["9dea9a29-bb82-214a-92f0-943af4411ac2"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Fri, 31 Jan 2014 20:19:03 GMT"...

Custom action to a callout in SharePoint 2013

Image
During my POC, I was trying to add custom action to a callout same like, Share and follow. found easy way to do it with following script. SP.SOD.executeFunc("callout.js", "Callout", function () { var itemCtx = {}; itemCtx.Templates = {}; itemCtx.BaseViewID = 'Callout'; // Define the list template type itemCtx.ListTemplateType = 101; itemCtx.Templates.Footer = function (itemCtx) { return CalloutRenderFooterTemplate(itemCtx, AddCustomAction, true); }; SPClientTemplates.TemplateManager.RegisterTemplateOverrides(itemCtx); }); function AddCustomAction (renderCtx, calloutActionMenu) { // Add custom action calloutActionMenu.addAction (new CalloutAction ({ text: "Custom Action", tooltip: 'This is your custom action', onClickCallback: function() { console.log('Alert from custom action'); } })); } We are good to go!!

PowerShell to Cancel All SharePoint Workflows in Progress

I was struck with requirement were having big list and workflow attached to it, need to cancel all running workflows.  It could be either manually traverse all the way and stop it, was next to impossible. Following script helped me to save my time! $web = Get-SPWeb "http://mysharepointserver.com/subsite"; $web.AllowUnsafeUpdates = $true; $list = $web.Lists["CustomListName"]; $count = 0 foreach ($listItem in $list.Items) { foreach ($workflow in $listItem.Workflows) { if(($listItem.Workflows | where {$_.InternalState -ne "Completed"}) -ne $null) { #Cancel Workflows [Microsoft.SharePoint.Workflow.SPWorkflowManager]:: CancelWorkflow($workflow); write-output "Workflow cancelled for : " $listItem.Title; } } } $web.Dispose(); Hope this will save your time!

SP2013 : Task list not visible to other users

I came across weird issue, I created a task list with the system account. This list is not able to view by any other users. Spent enough time on finding a cause. It was all due to IE, it was working fine with Chrome and other browsers. To make it work with IE: 1.  Active x and JS permissions has to be enabled. 2.  The site has to be in the trusted pool of you internet explorer.   3. D isable any extra add-o ns. Hope this small piece of information will save time

Create a custom view on Workflow Task Status

Image
I came across to the requirement to create a custom view based on workflow status. Requirement was to show all the approved items. I found a interesting stuff, Filter will not work if we use words like below image: we would need use the number rather than the words (e.g. 2 instead of In Progress, 4 instead of Cancelled etc) Following list might help for this kind of requirement: Status Value Not Started 0 Failed on Start 1 In Progress 2 Error Occurred 3 Canceled 4 Completed 5 Failed on Start (retrying) 6 Error Occurred (retrying) 7 Canceled 15 Approved 16 Rejected 17 Hope this will save your time!

Provider Hosted App - Azure and Read, Write to SharePoint List with real example

Hi, After my first blog on simple app, http://anujabhojani.blogspot.in/2013/06/step-by-step-sharepoint-2013-provider.html Now will go in detail about how to read and write SharePoint list with Provider Hosted App. Here to cover all the scenario implementing it with real example by creatingvTrello App. http://www.trello.com is basically a task management tool. I am developing app which will have following functionality, 1. App will take user token (oauth) from Trello to read all the cards  for current logged in user. 2. Trello will return token, which our app will store in one SharePoint list so next time when user visit the app, will get the token from list and directly get all the cards from trello. Now, lets start and build this app. 1. Having Default.aspx in my solution, adding following code in page_load to get the access token public partial class Default : System.Web.UI.Page { public static string userToken = string.Empty; Uri appWeb; s...