K2 Workflow menu is missing in list item context menu of SharePoint Online list (integrated with Workflow)

  • 16 February 2021
  • 0 replies
  • 34 views

Userlevel 5
Badge +20
 

K2 Workflow menu is missing in list item context menu of SharePoint Online list (integrated with K2 Workflow)

kbt180507

PRODUCT
K2 Cloud Update 11
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.

Issue

The K2 Workflow menu disappeared from a SharePoint Online list integrated with workflow (although it used to be available before).

Symptoms

K2 Cloud Update 11 FP11 integrated with SharePoint Online: The K2 Workflow menu disappeared from a SharePoint Online list integrated with workflow (where it used to be available before).

When the SharePoint Online list is integrated with workflow, the manual start list item context menu is supposed to have a "K2 Workflows" menu option - but it is missing. Please see the K2 product help section "Start a Workflow Manually in SharePoint" which provides additional information on this product functionality.

Resolution

You can use PowerShell to make this menu available:

Add-Type -Path “C: empMicrosoft.SharePoint.Client.dll”
Add-Type -Path “C: empMicrosoft.SharePoint.Client.Runtime.dll”
function NewSPAction($SiteUrl, $Credentials)
{
$appweb = "https://your_tenant.sharepoint.com/sites/appcatalog/K2forSharePoint"
$context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
$context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Credentials.UserName,$Credentials.Password)
$site = $context.Web
$context.Load($site)
$context.ExecuteQuery()
$UserCustomActions = $site.UserCustomActions
$context.Load($UserCustomActions)
$context.ExecuteQuery()
$action = $UserCustomActions.Add()
$action.RegistrationType = "ContentType";
$action.RegistrationId = "0x01"
$action.Location = "EditControlBlock";
$action.Sequence = 899;
$action.Title = "K2 Workflows";
$action.Url = $appweb + "/Pages/Application.aspx?formUrl=/Runtime/Form/K2+Workflow+Manual%3FSPSiteURL%3D{SiteUrl}&SPListId%3D{ListId}&SPItemId%3D{ItemId}&SPItemUrl%3D{ItemUrl}&Source%3D{Source}";
$action.Update();
$context.ExecuteQuery()
WRITE-HOST “K2 Action added…” -ForegroundColor Green
}
$Creds = Get-Credential
$SiteUrl = “https://your_tenant.sharepoint.com/sites/your_site”
NewSPAction -SiteUrl $SiteUrl -Credentials $Creds
WRITE-HOST "DONE"

NOTE: You may need enable custom scripts execution on SharePoint online side to get this script working.

 


0 replies

Be the first to reply!

Reply