Pages

Showing posts with label SharePoint 2013 Workflow. Show all posts
Showing posts with label SharePoint 2013 Workflow. Show all posts

Thursday, January 26, 2017

System.NullReferenceException: Object reference not set to an instance of an object when deploying SharePoint 2013 workflow solution

Problem

I was trying to deploy a workflow solution using Visual Studio 2013; when I tried I got an exception as “Error occurred in deployment step 'Activate Features': System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.SharePoint.WorkflowServices.WorkflowSubscriptionStorageEventReceiver.ItemUpdating(SPItemEventProperties properties)”.

Solution

We have to configure Workflow Manager on a server that is part of the SharePoint 2013 farm and on which communication takes place by using HTTP.

  Register-SPWorkflowService -SPSite "http://sharepoint-sp:29375/" -WorkflowHostUri "http://localhost:12291/" -AllowOAuthHttp

Reference

https://technet.microsoft.com/en-us/library/JJ658588.aspx

Friday, June 27, 2014

Remove the Content Type drop down in SharePoint 2013 Workflow Task list

Introduction

So, Here is my second post on SharePoint 2013 workflow.

Problem Background

After creating a workflow task through custom content type, there is a dropdown showing the content types which were inherited from workflow tasks content type as in the screenshot below. I need to hide the drop down.

image

Solution 01

  1. Open the the Workflow Task list in browser
  2. Go to list settings and click on Advanced Settings
  3. There under “Content Types”, you have “Allow management of content types?” as radio buttons
  4. Select “No” option.

image

Solution 02

  1. Open the the Workflow Task list through SharePoint Designer 2013.
  2. Under setting panel there is a check box for “Allow management of content types”. Un tick that check box and save.

image

Conclusion

Now the user cannot see the dropdown for selecting content type.

image

Thursday, June 26, 2014

Create custom outcome options in workflow tasks for SharePoint 2013 workflow

Introduction

I was assigned to a project where I need to come up with workflow as a part of the module. For the first time I’m developing SharePoint workflows and I may get a chance to share some of the knowledge I will be gaining in upcoming days.

Problem Background

I had to assign a workflow task to a user and the task out come should be “Submit” and “Reject”. The default is usually “Approved” and “Rejected” as shown in the below screenshot.

image

The requirement is something like this.

image

Solution

  • You have to create a custom content type
    • Go to Site Settings –> Site content types –> Click Create
        • Fill Name and Description field
        • Select “List Content Types” under “Select parent content type from:”
        • Select “Workflow Task (SharePoint 2013)” "under “Parent Content Type:”
        • See the screen shot.

      image

        • Click OK
        • Once the page is redirected to the content type page ensure that the parent of the content type is Workflow Task (SharePoint 2013)

image

  • Add new site columns with the options we need for new task out come.
    • On the Site Content Type Page under Columns click “Add from new site column”
    • Give the Column Name as your wish
    • The type of information in this column is: should be “Task Outcome”
    • and you have to give the choices in “Type each choice on a separate line:” text area. I have given Submit and Reject.

    image

  • Remove the default task out come from the created content type
    • Click on Task Outcome under Columns section and click Remove.
  • Lets assign set the outcome option with the above create content type
    • Create a List workflow through SharePoint designer 2013
    • From the action menu add Assign a task action
    • Click this user and set the Participant and task title
    • Click Outcome options and select the content type created here the name of the content type is “Name” as we created above.

    image

  • Now we can get the output values from the workflow in the designer.

image

  • When we select the custom content type we will get an alert in read saying “Check to make sure this content type is applied to the workflow’s task list”
    • When we assign a task the task is created in a separate list. The default is Workflow task list. We can create as we want.
    • We can see the task list in workflow settings page

image

  • We have set the above created content type to the workflow task list.
    • Go to Workflow task list (Or your custom task list) through site content page
    • Then List Setting –> Under Content Types click “Add from existing site content types”
    • Add the content type we created.

image

    • Click OK.

That's all.

Conclusion

Now once we assign a task the task will have the above created outcome options in the tasks item. Don't miss the point associating the content type with the task list; else you will get a exception.