K2 Workflow menu is missing in list item context menu of SharePoint Online list (integrated with K2 Workflow)
kbt180507
PRODUCTIssue
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.