3

I am working a sharepoint enterprise server 2013, where i have saved a sub-site as template. now this sub-site have a content type which that is linked to a global workflow 2010. but when i try to create new sub-site based on this site temple i got errors which are related to the workflow status fields which which get created inside the original sub-site..

Here is the full scenario of my problem:-

  1. I created custom site content type.
  2. I have created a global workflow 2010 using sharepoint designer 2013, and I associate the custom content type with the global workflow. i name the global workflow nwf
  3. I have a site collection at /sites/pmo & I have a subsite at /sites/pmo/prog/

  4. Inside the /sites/pmo/prog sub-site i created a new sub-site based on the "Team site template" , the subsite url = /sites/pmo/prog/TempleteSite

  5. inside the /sites/pmo/prog/TempleteSite sub-site i added a custom list which uses the custom content type.

  6. i test the global workflow by creating new items inside my /sites/pmo/prog/TempleteSite list. where when the global workflow is executed it will automatically add a new field named "nwf" to the default list view.

  7. then i save the /sites/pmo/prog/TempleteSite sub-site as template. so i can create new sub-sites based on this templete

  8. After that i created many sub-sites (subsiteA, subsiteB, subsiteC, etc.. ) based on the new site template, and every thing is working well (seems to be working well).

  9. but i have noted that on the new sub-sites which is created based on the template, an additional workflow status field will be created named "nwf0" beside the old "nwf" workflow status field which was created inside the original sub-site. where the nwf0 will actually show the global workflow status (such as started, in-progress, complete),, while the nwf list column which was part of the site template will not show anything inside the new sub-sites.

  10. now i save one of the new sub-sites (subsiteA) as template.

  11. but when i try to create a new sub-site based on the newer template .

  12. i got this exception:- enter image description here

now i enable the verbose logging and i re-try to create a new sub-site with the following url http://tgvsg01/sites/pmo/prog/testtest100, and here is the related logs which contain exceptions:-

01/24/2017 16:52:52.39  w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           Monitoring                      nass    Verbose     ____Execution Time=1491.10403696559 1c39ce9d-fc5d-d003-e007-3db63e066187
01/24/2017 16:52:52.39  w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           General                         c97d    Unexpected  Exception attempting to ApplyWebTemplate to SPWeb http://tgvsg01/sites/pmo/prog/testtest100: Microsoft.SharePoint.SPException: Cannot complete this action.  Please try again. ---> System.Runtime.InteropServices.COMException: <nativehr>0x8107058a</nativehr><nativestack>owssvr.dll: (unresolved symbol, module offset=00000000000E9464) at 0x000007FEEDA49464 owssvr.dll: (unresolved symbol, module offset=00000000000E0C50) at 0x000007FEEDA40C50 owssvr.dll: (unresolved symbol, module offset=00000000000E08EE) at 0x000007FEEDA408EE owssvr.dll: (unresolved symbol, module offset=0000000000063AB7) at 0x000007FEED9C3AB7 owssvr.dll: (unresolved symbol, module offset=00000000000241B5) at 0x000007FEED9841B5 Microsoft.SharePoint.Library.ni.dll: (unresolved symbol, module offset=00000000000C5FAF) at 0x0000...    1c39ce9d-fc5d-d003-e007-3db63e066187
01/24/2017 16:52:52.39* w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           General                         c97d    Unexpected  ...07FEEEA95FAF Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000002B8EC05) at 0x000007FECBB2EC05 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000002ACD3D0) at 0x000007FECBA6D3D0 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000002ACD887) at 0x000007FECBA6D887 </nativestack>Cannot complete this action.  Please try again.     at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId)     at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateC...  1c39ce9d-fc5d-d003-e007-3db63e066187
01/24/2017 16:52:52.39* w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           General                         c97d    Unexpected  ...ontentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId)     --- End of inner exception stack trace ---     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)     at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId)     at Microsoft.SharePoint.SPWeb.ProvisionWebTemplate(SPWebTemplate webTemplate, String webTemplateToUse, SPFeatureWebTemplate featureWebTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& featureDependencyEr...  1c39ce9d-fc5d-d003-e007-3db63e066187
01/24/2017 16:52:52.39* w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           General                         c97d    Unexpected  ...rors)     at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& featureDependencyErrors)     at Microsoft.SharePoint.ApplicationPages.TemplatePickerUtil.ApplyWebTemplateAndRedirect(SPWeb Web, String strWebTemplate, Nullable`1 bSharedNav, Boolean bOnTopNav, Boolean bOnQuickLaunch, Page page, Boolean bDeleteOnError, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& featureDependencyErrors) Attempting to delete the site collection.    1c39ce9d-fc5d-d003-e007-3db63e066187
01/24/2017 16:52:52.39  w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           General                         8e1d    High        Deleting the web at http://tgvsg01/sites/pmo/prog/testtest100 . 1c39ce9d-fc5d-d003-e007-3db63e066187

so can anyone advice what might be causing this problem ?

now one note i have. as i mentioned before is that inside the new subsiteA there are 2 list columns with the following internal names nwf & nwf0 those are workflow status columns which were created automatically as part of a global workflow 2010 which is linked to the content typec (the nwf was created inside the site which i save as templete, while the nwf0 was created inside the subsiteA ). So could those columns be causing the problem, as on the logs i find the following:-

01/24/2017 16:52:52.28  w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           Database                        tkeb    Verbose     Setting database session for 057ee984-be51-4fcb-ba0b-bc712c3a4f85 and site be322355-bf98-4f71-9d93-65f9991260bc.    1c39ce9d-fc5d-d003-e007-3db63e066187
01/24/2017 16:52:52.28  w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           General                         al28d   Medium      Replacing SourceId attribute value {$ListId:Lists/risk;} with list Id {F2895388-8240-44A0-AEBD-CFADD84A0816} for field Id {11ed43e8-ae2e-4089-bf4c-31c7b45b6324} (field name nwf) for list risk in web http://tgvsg01/sites/pmo/prog/testtest100    1c39ce9d-fc5d-d003-e007-3db63e066187
01/24/2017 16:52:52.28  w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           General                         al28d   Medium      Replacing SourceId attribute value {$ListId:Lists/risk;} with list Id {F2895388-8240-44A0-AEBD-CFADD84A0816} for field Id {eff88270-dfb0-49b3-b6a3-fcba4ea194ba} (field name nwf0) for list risk in web http://tgvsg01/sites/pmo/prog/testtest100   1c39ce9d-fc5d-d003-e007-3db63e066187
01/24/2017 16:52:52.28  w3wp.exe (0x20D4)                           0x0EA8  SharePoint Foundation           General                         acq1g   High        Feature  schema contain wrong field name : feature name = {00bfea71-de22-43b2-a848-c05709900100}, field name  nwf0  1c39ce9d-fc5d-d003-e007-3db63e066187

which is saying that a column named nwf0 is not valid,, but i did not create these columns !! so not sure if this could be causing the problem ? and how i can remove these columns? as they are not part of the content type or list columns ,, they only appear inside the list view setting page ...

now after full day of investigation, i tried this approach , but not sure if i am doing things correctly :-

  1. i run the following power-shell command twice to remove the 2 workflow fields from the related list (now both fields have the same display name nwf):-
$web = Get-SPWeb -identity http://tgvsg01/sites/pmo/prog/subsiteA/
$list = $web.Lists["risk"] 
$column = $list.Fields[“nwf”] 
$column.Hidden = $false 
$column.ReadOnlyField = $false 
$column.Update() 
$list.Fields.Delete($column)
  1. this have removed the 2 fields from my list, inside subsiteA.

  2. but now if i try to access the workflow section of any list item i will get an exception. i think the exception is related to the fact hat the workflow page is referencing one of the workflow fields which is no longer exists.

  3. so i went to my global workflow,, i de-associated it from the site content type. then i re-associated it with the content type again and i give it a new name.

  4. after that i saved subsiteA as template

  5. and i was able to create new sub-site based on the site template...

so i am totally confused on how i need to appraoch this.. i mean i did not do anything special ,, i just create global workflow using sharepoint designer and associate it with a content type,, save a sub-site as template, try to create new sub-site based on this template...but seems the workflow status fields is somehow causing problems ... can anyone advice on this problem and not sure if my sub-sites which were created using the original site template are considered in-valid ,, since i can not save them as template, also some of these sites already contain live data !!

2
+50

Workflows, designed in the SharePoint designer use hard coded GUIDs so they do not play nice when exporting/importing including saving site as a template. What goes wrong I guess, is that the workflow in the new sites, based on TemplateSite have the workflow created with new GUIDs and name and thus the list gets a new column for the new workflow. The old one is still there, because, well it is part of the template now.

I suggest to make the workflow as "Reusable workflow" with SPD and export it as a feature. Then you can import that feature in the TemplateSite and activate it, and include it in the exported template.

Because I am curious: is it your initial scenario working well, when the first template is imported into another site collection?

  • i did not try to import the template inside another site collection so i can not answer your question..,,, but can you adivce about my 6 steps which seems to fix the issue ? are those steps valid ? – john Gu Jan 30 '17 at 1:23
  • If my understanding of the case is correct, re-association of the workflow in your step 4 recreates the fields in the list, and since you removed previously created columns with the same name, the new association is OK. So I think your six steps are a viable solution. But I guess that if you try to create a new template from one of the sites based on the modified template, you will probably face the same issue, and you will have to repeat those six steps with it too. – Tsvetelin Pavlov Feb 2 '17 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.