Pages

Monday, May 15, 2017

Starting a workflow in a SharePoint List using PowerShell

You can start workflow on your SharePoint list items using PowerShell with the following code:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
# URL of the Site
$web = Get-SPWeb -Identity
<Your SharePoint SIte URL>
 
$wfmanager = $web.Site.WorkFlowManager
 
#List where you would like to start the workflow
$list = $web.Lists["YOUR_LIST_NAME"]
 
# Name of the Workflow
$assoc = $list.WorkflowAssociations  |Where { $_.Name -eq "YOUR_WORKFLOW_NAME"}
Write-Host $assoc.AssociationData
 
$data = $assoc.AssociationData
$items = $list.Items

foreach($item in $items)
{
Write-Host "Processing " $item.ID

#Uncomment the following lines if you would like to start the workflow selectively. Alternatively, you can use a CAML query and rretrieve only selective items
#if ($item["Status"] -eq "Pending")
  #      {
$wf = $wfmanager.StartWorkFlow($list.GetItemById($item.ID),$assoc,$data,$true)
#}
}
#Dispose
$manager.Dispose()
$web.Dispose()

If you get the following error in PowerShell when running this script, it generallyindicates that your workflow name is not correct. You have to use your workflow name exactly as it appears in your view settings.

SharePoint 2013 – Exception calling “StartWorkflow” with “4” argument(s):

Tuesday, April 25, 2017

Intel Hardware Acceleration Manager (HAXM) Error in Visual Studio Installed on VMWare Machine when trying to Run the Android Emulator

You may receive this error while setting up a virtualized development environment for Visual Studio Android development and trying to run the Android emulator.  The error message will indicate in Android SDK Manager that HAXM is not compatible. The error is can be seen in the picture below:

image 

In addition, when you try to download the HAXM software manually from the Intel site at https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager and run “installhaxm-android.exe”, you get a message that the Intel virtualization technology is not enabled. In some cases, this is due to Hyper-v Windows feature being enabled. You can try to disable it by going to Control Panel –> Programs –> Turn windows feature on or off and unchecking “Hyper-V” and try again.

 

image

 

If the emulator still doesn’t run, check and confirm that your host Virtualization technology is enabled in BIOS. If it is enabled, then update your VM settings after turning it off and editing the processor setting as indicated below:

Preferred Mode: “Intel VT-x/EPT or AMD-V/WVI” (Automatic will not work)

Virtualize Intel VT-x/EPT or AMD-V RVI = Checked

 

image

Note: The options are disabled as my VM is running at the moment. Smile

Hope it helps!

Wednesday, January 11, 2017

SharePoint Excel Services and Office Web Apps Server: The following connections failed to refresh

When working with Excel services and external data when you also have Office Web Apps server installed in your farm, you may get the following error when trying to refresh your Excel file:

image

If you have setup Excel Service unattended service account in secure store and have setup access to your data sources properly and are still getting this error, it may because your Excel files are opening using Excel Web App which doesn’t support external data refresh. You can determine if Excel Web App or Excel Services is being used for opening the Excel files by looking at the URL: if it contains WopiFrame.aspx, it means the file is being opened using Excel Web application and if it has xlviewer.aspx, it means the file is being opened using Excel service application. From the Microsoft site:

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

Differences between Excel Web App and Excel Services in SharePoint


Excel Web App and Excel Services in SharePoint have a lot in common, but they are not the same. Excel Services is available only in the Enterprise edition of SharePoint Server 2013. Excel Web App is available in SharePoint Server 2013 and SharePoint Foundation 2013. Both applications enable you to view workbooks in a browser window, and both enable you to interact with and explore data.

But there are certain differences between Excel Web App and Excel Services in SharePoint. For example, Excel Services supports external data connections, data models, and the ability to interact with items that use data models (such as PivotChart reports, PivotTable reports and timeline controls). Excel Services provides more business intelligence functionality than Excel Web App, but Excel Services does not enable users to create or edit workbooks in a browser window.

For details about the differences between the Excel Web App and Excel Services, see Overview of Excel Services in SharePoint Server 2013 and Comparing Excel Services in SharePoint to Excel Web App.

If your organization decides to use Excel Services instead of Excel Web App to view workbooks in the browser, you can use the Windows PowerShell New-SPWOPISuppressionSettings cmdlet to turn off Excel Web App for Excel workbooks. For more information, see New-SPWOPISuppressionSetting.

 

In order to change the default behavior so that Excel files are opened using Excel services, you will have to suppress Office Web Apps for view operations using the following command followed by IISRESET:

New-SPWOPISuppressionSetting –Extension “XLSX” -Action “view”

This should fix the external data refresh issue.

Wednesday, January 4, 2017

SharePoint Apps: Custom List Form – Ribbon buttons are greyed out

When working with custom list forms using Visual Studio, by default, you will notice that the ribbon buttons are greyed out. 

image

You can resolve this issue by adding the <SharePoint:FormToolbar> control under PlaceHolderMain placeholder.

<SharePoint:FormToolBar runat="server"/>

image

Tuesday, December 6, 2016

Visual Studio 2015 Crashes when using SharePoint workflow "Assign" Activity

Visual Studio 2015 crashes when trying to use the assign activity in a SharePoint workflow.

image

In order to resolve this issue, you will need to assign the variables “To” and “Value” using the properties pane.

imageimage

Monday, December 5, 2016

Visual Studio SharePoint Workflow - DynamicValue Variable Type is Missing

When trying to add a DynamicValue variable type in a Visual Studio 2015 SharePoint workflow, you may notice that the type is missing.

image

This can happen if Microsoft.Activities namespace is not referenced in your project. Add the reference and you can access the DynamicValue variable type.

image

image

Sunday, December 4, 2016

SharePoint 2013/2016 Workflows are Cancelled

When working with SharePoint 2013/2016 workflows, the workflows are cancelled by the system with the following similar error message:

 

  • RequestorId: e88c6282-6a6a-710f-1045-5697183081a9. Details: System.ApplicationException: HTTP 401 {"error_description":"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."} {"x-ms-diagnostics":["3001000;reason=\"There has been an error authenticating the request.\";category=\"invalid_client\""],"SPRequestGuid":["b8975112-6d46-4c69-a66f-87031b27db53"],"request-id":["b8975112-6d46-4c69-a66f-87031b27db53"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"SPRequestDuration":["46"],"SPIisLatency":["0"],"Server":["Microsoft-IIS\/8.5"],"WWW-Authenticate":["Bearer realm=\"03bd1a89-605f-4d25-baa7-5eb9f69897a3\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"00000005-0000-0000-c000-000000000000@*,00000003-0000-0ff1-ce00-000000000000@03bd1a89-605f-4d25-baa7-5eb9f69897a3\"","NTLM"],"X-Powered-By":["ASP.NET"],"MicrosoftSharePointTeamServices":["15.0.0.4569"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Date":["Sat, 03 Dec 2016 22:04:48 GMT"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

 

Ensure about the following:

  • User profile and user profile synchronization services are started. Make sure that you have configured permissions for service accounts properly. For development machine, you can add thye service accounts to the domain administrator group.
  • Full profile synchronization is completed.

Saturday, December 3, 2016

SharePoint Designer Crashes when Trying to use Visual Designer for Workflow

When trying to use Visual Designer in SharePoint Designer for workflow development, SharePoint Designer crashes. Make sure that you have SharePoint Designer 2013 and Visio 2013 installed for SharePoint 2013 and SharePoint Designer 2016 and Visio 2016 installed when using SharePoint 2016.

Server-side activities have been updated. You need to restart SharePoint Designer to use the updated version of activities.

When working with SharePoint Designer 2013/2016, you may get the following error:

“Server-side activities have been updated. You need to restart SharePoint Designer to use the updated version of activities.”

This issue can happen if Visual Studio and SharePoint Designer are installed on the same machine which is the case for development machines.

  • Try installing SharePoint Designer update from https://support.microsoft.com/en-us/kb/3114337.
  • Removing Visual Studio and installing it again should fix the issue.
  • Check if you have Workflow Manager Client installed and uninstall it and it should fix the issue.

Tuesday, November 29, 2016

Reinstall NUGET Packages in a Visual Studio Project

Follow these steps:

  1. Start Tools –> NUGET Package Manager –> Package Manager Console
  2. Type the following command and hit enter

    Update-Package –reinstall –project <PROJECT_NAME>