Undocumented issue in OOB three state worflow of SharePoint Online

Sriram Varadarajan
 
Solution Architect
January 24, 2016
 
Rate this article
 
Views
13329

One the known issue (not disclosed by MS) is default OOB three state workflow won’t work in SharePoint Online for some the tenants. We had this issue in one of the sub site which is under the root site collection of our SharePoint online tenant, initially when the workflow wasn’t working, we couldn’t really understand the cause of this issue, and we tried re-creating the WF multiple times without knowing the root cause.

Finally, we managed investigate this case further and here are our findings and fix.

As a first step, we started collecting the LOGS using fiddler, and after analyzing the log carefully we identified the following errors that were seen repeatedly:

The schema for field with this id is wrong or missing. Field ‘{7d95d1f4-f5fd-4a70-90cd-b35abc9b5bc8}’

– We checked and found that this is a hidden field on the top level site.

  • 7d95d1f4-f5fd-4a70-90cd-b35abc9b5bc8 –  All Day Event –  fAllDayEvent –  fAllDayEvent

– Using the SharePoint Online Client browser tool, we checked root site and determined the SchemaXML of this field as below:

SchemaXML:

 <Field ID="{7D95D1F4-F5FD-4a70-90CD-B35ABC9B5BC8}" Type="AllDayEvent" Name="fAllDayEvent" DisplayName="All Day Event" Sealed="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="fAllDayEvent" Group="_Hidden" >
   <FieldRefs>
     <FieldRef ID="{64cd368d-2f95-4bfc-a1f9-8d4324ecb007}" Name="EventDate" RefType="StartDate" />
     <FieldRef ID="{2684F9F2-54BE-429f-BA06-76754FC056BF}" Name="EndDate" RefType="EndDate" />
     <FieldRef ID="{6CC1C612-748A-48d8-88F2-944F477F301B}" Name="TimeZone" RefType="TimeZone" />
     <FieldRef ID="{C4B72ED6-45AA-4422-BFF1-2B6750D30819}" Name="XMLTZone" RefType="XMLTZone" />
   </FieldRefs>
 </Field>

With these details we involved MS and they investigated the Root site more from the backend and found a lot more inconsistencies regarding certain Site columns that are responsible for the three-state workflow to fail.

They found that the issues with the below Fields that are responsible for the working of the Three-state workflow:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.ArgumentException: Invalid field name. {17ca3a22-fdfe-46eb-99b5-9646baed3f16}  /XXXX/Temp/Lists/Tasks   

 

Using CSOM, they checked and found that this OOD hidden field “form_URN” was missing on our root site.

They checked a working site and got the schemaXML of the missing field. Created a new field with the working schema on our root site using CSOM.

But, this didn’t help too and when investigated further they found out that, a lot of such hidden column was missing.

Here are the list of hidden fields which were missing:

· Name="FormURN" ; ID= 17ca3a22-fdfe-46eb-99b5-9646baed3f16

· Name="SendEmailNotification" ; ID= CB2413F2-7DE9-4afc-8587-1CA3F563F624

· Name=”HasCustomEmailBody” ; ID= 47f68c3b-8930-406f-bde2-4a8c669ee87c

· Name="WorkflowLink" ; ID= 58DDDA52-C2A3-4650-9178-3BBC1F6E36DA

· Name="ExtendedProperties" ; ID= 1C5518E2-1E99-49FE-BFC6-1A8DE3BA16E2

· Name="EmailBody" ; ID= 8CBB9252-1035-4156-9C35-F54E9056C65A

· Name="Completed" ; ID= 35363960-D998-4aad-B7E8-058DFE2C669E

CSOM used to create these hidden fields:

Sample CSOM code used:

 #Install SharePoint online client SDK before you run the below 
 [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint.Client')
 [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint.Client.Runtime')
 [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint.Client.UserProfiles')
 [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint.Client.Taxonomy')
 
 ##Get GA credentials.
 $username = Read-Host -Prompt "GA username"
 $password = Read-Host -Prompt "password? " -AsSecureString
 
 ##URL of the Site Collection:
 $url = "https://consoto.sharepoint.com/sites/site1"
 
 #Connect/authenticate to SharePoint Online and get ClientContext object.. 
 $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
 $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url) 
 $ctx.Credentials = $credentials 
 
 
 if (!$clientContext.ServerObjectIsNull.Value) 
 { 
     Write-Host "Connected to SharePoint Online site: '$Url'" -ForegroundColor Green 
 } 
 
 #############################################################
 #To load the root site
 $rootweb = $ctx.Web  
 $ctx.Load($rootweb)
 $ctx.ExecuteQuery()
 
 #To get the lists on the site:
 $lists = $rootweb.lists
 $ctx.Load($lists)
 $ctx.ExecuteQuery() 
 
 $lists | select title
 
 #Get the  List:
 $list_problem = $lists.GetByTitle("Workflow Tasks") #Name of a working lib.
 $ctx.Load($list_problem)
 $ctx.ExecuteQuery()
 
 
 #############################################################
 #To get the Fields of the top level web:
 $webfields = $rootweb.Fields
 $ctx.Load($webfields)
 $ctx.ExecuteQuery() 
 
 foreach($webfdtop in $webfields)
 {
     Write-Host $webfdtop.Id  "-- " $webfdtop.Title "-- " $webfdtop.staticname "-- " $webfdtop.InternalName
 }
 #############################################################
 
 #############################################################
 #Get Fields of the list:
 $listfields = $list_problem.Fields
 $ctx.Load($listfields)
 $ctx.ExecuteQuery() 
 
 #See all fields of working list
 foreach($fd1 in $listfields)
 {
     Write-Host $fd1.Id  "-- " $fd1.Title "-- " $fd1.InternalName
 }
 #############################################################
 
 #############################################################
 #To load a specific web field field by ID
 $webfd = $webfields.GetById(‘17ca3a22-fdfe-46eb-99b5-9646baed3f16')
 $ctx.load($webfd)
 $ctx.ExecuteQuery()
 $webfd.SchemaXml
 $webfd | fl

This is one of many Known issue in SharePoint online, my following articles will also talk more on other known issue in SharePoint online, which aren’t disclosed by MS.

Author Info

Sriram Varadarajan
 
Solution Architect
 
Rate this article
 
Sriram is a Technology Evangelist with 15+ years experience in Microsoft Technologies. He is an enterprise architect working for large pharmaceutical organization which has presence globally with largest Microsoft implementation ...read more
 

Leave a comment