Exercise 2: Test the Custom Action in SharePoint Online

Task 1 – Deploy Custom Workflow Action to SharePoint Online

In this task you will deploy the custom workflow action to SharePoint Online.

  1. From the Solution Explorer window, right-click the SPDCustomWorkflowActions project and select Package to package the solution WSP.
  2. Launch Internet Explorer and navigate to your top-level SharePoint Online site; e.g.: https://contoso.sharepoint.com.
  3. Click SiteActions >> Site Settings.
  4. Under Galleries, click on the Solutions link to view the site collection’s SolutionGallery.
  5. Click on the Solutions tab in the ribbon to view the Upload Solution button.
  6. Click the Upload Solution button.
  7. Browse to C:\%Office365TrainingKit%\Labs\3.2\Source\Before\Visual Studio\SPDCustomWorkflowAction\bin\Debug\SPDCustomWorkflowActions.wsp and click Open and OK.
  8. In the Solution Gallery – Activate Solution dialog, click the Activate button on the Ribbon to activate the solution.

  9. Click the Activate button on the ribbon to activate the solution.

Task 2 – Save the Updated Workflow as a Template

In this task, you use SharePoint Designer to save your completed workflow as a template. This will create a .wsp file, which can be used to move the workflow from a development environment to a test or production environment. You will upload this file to SharePoint Online. The file can also be imported into Visual Studio for developers to investigate how the workflow is assembled.

Note:
If you import the .wsp into Visual Studio, you will only be able to import it as a farm solution, which cannot be re-deployed to SharePoint Online.
  1. Open SharePoint Designer
  2. From the left navigation, select Workflows >> Non-Standard Business Purchase Approval
  3. Select Save as Template.
  4. The .wsp will be saved to the Site Assets library of your local SharePoint site, e.g., https://intranet.contoso.com/Lab03/SiteAssets.

  5. Open the Site Assets library, select Non-Standard Business Purchase Approval.wsp and click the Preview in Browser icon. You will be prompted to save the file; save the file to the desktop.

Note:
If you completed Lab 3.1, the file Non-Standard Business Purchase Approval.wsp will already exist in the Site Assets folder. The new file will be saved as Non-Standard Business Purchase Approval2.wsp; after you save this file to your desktop, rename it back to Non-Standard Business Purchase Approval.wsp.

Task 3 – Upload the Updated Workflow Template to SharePoint Online

In this task, you will upload the updated Non-Standard Business Purchase Request workflow template to SharePoint Online.

  1. Browse to your top-level SharePoint Online site; e.g.: https://contoso.sharepoint.com.
  2. Click Site Actions >> Site Settings.
  3. Under Galleries, click on the Solutions link to view the site collection’s Solution Gallery.

  4. The Non-Standard Business Purchase Approval.wsp will already be in the Solution Gallery if you completed Lab 3.1.
  5. Select and the solution and click Deactivate to deactivate it.

  6. Click on the Solutions tab in the ribbon to view the Upload Solution button.

  7. Click the Upload Solution button.
  8. Browse to your desktop and select Non-Standard Business Purchase Approval.wsp and click Open and OK.
  9. In the Solution Gallery – Activate Solution dialog, click the Activate button on the ribbon to activate the solution.

    Note:
    Activating the solution will close the dialog automatically.
  10. Browse to the Lab03 site; e.g.: https://contoso.sharepoint.com/Lab03.
  11. Click Site Actions >> Site Settings and under the Site Actions group choose Manage Site Features.
  12. Activate the Workflow template "Non-Standard Business Purchase Approval" from web template "Lab03" feature.

Task 4 – Associate the Purchase Request Approval Workflow

  1. Browse to your SharePoint Online site; e.g.: https://contoso.sharepoint.com/Lab03.
  2. Open the Non-Standard Business Purchase Requests list from the Quick Launch.

  3. Select List >> Workflow Settings from the ribbon

  4. Select Purchase Request from the drop down list.
  5. Click Remove a workflow.
  6. Choose No New Instances, and click OK. This prevents any new instances of the old version of the Non-Standard Business Purchase Request Approval workflow to be created on the list.

  7. Select Purchase Request from the drop down list, and click Add a workflow.

  8. In the next screen, select the Non-Standard Business Purchase Approval Workflow workflow template name the workflow Non-Standard Business Purchase Approval - Custom Action.

  9. Click Save on the next screen.
  10. The updated version of the workflow is now associated with the list.
  11. Follow the steps in Exercise 1 >> Task 4 to test the custom workflow action.