Mar 20 2017 03:38 AM
I get an exception when trying to create a new list using PowerShell (error also happens in C#).
This is my PowerShell:
$lists = $rootWeb.Lists $index = $lists.Add("avrTest", "", [Microsoft.SharePoint.SPListTemplateType]::GenericList)
The error received is:
Exception calling "Add" with "3" argument(s): "Invalid field name. {1faa4902-9115-44b9-bba7-791441ca1d6f}
/Lists/avrTest"
At line:1 char:1
+ $index = $lists.Add("avrTest", "", [Microsoft.SharePoint.SPListTempla ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
The field referred to has nothing to do with a generic list, but it is a core field in ONET.XML (and in fieldswss4.xml:(
<Field ID="{1FAA4902-9115-44B9-BBA7-791441CA1D6F}" Name="SMTotalFileStreamSize" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="SMTotalFileStreamSize" Group="_Hidden" ColName="DocSize" RowOrdinal="0" ReadOnly="TRUE" Type="Lookup" List="Docs" ListInternal="StorageMetrics" ShowField="SMTotalFileStreamSize" JoinColName="Id" DisplayName="$Resources:core,StorageMetrics_TotalFileStreamSize;"> </Field>
This is a SharePoint 2016 system, patched to the March 2017 CU, with the full Enterprise/BI stack installed. The error was occurring on the previous pach level (Dec 2016 CU) as well.
I don't understand how this field is getting in the way, nor how to get around it.
Can anyone help me?
Thanks,
Andrew
Mar 20 2017 04:37 AM
There are two fields that could be invalid here. Either the Lookup field that you are creating with the new list (this is unlikely to be the problem)
or the list that is used buy the lookup field. You might want to check your Docs library/list if the fields used by the lookup field exist or not. It looks like you are connecting to a field called SMTotalFileStreamSize while your new lookup field that is part of the new list also is called SMTotalFileStreamSize.
Mar 21 2017 11:48 PM
Thanks for the reply Pieter.
The thing is, I am not creating any lookup fields. I am creating a straight-forward, unadorned, custom list, using hte Microsoft template, which should just have a Title field and the standard author and date fields.
I have no idea where the reference to SMTotalFileStreamSize is coming from.
Mar 22 2017 12:13 AM
Mar 22 2017 12:45 AM
Mar 22 2017 12:59 AM
Mar 22 2017 01:26 AM
Nov 15 2018 03:24 AM
Just de-activating and re-activating these features fixed the initial problems, but doing them out of order also disabled some publishing features on existing pages. I ended up creating a backup and restoring to a sandbox site multiple times in order to test different orders of de-activation and activation.
stsadm -o deactivatefeature -name publishingresource -url "sitecollectionurl" -force stsadm -o deactivatefeature -name publishingweb -url "subsiteurl" -force stsadm -o deactivatefeature -name publishingsite -url "sitecollectionurl" -force stsadm -o deactivatefeature -name fields -url "sitecollectionurl" -force
And then re-activate the features in the reverse order. The fields feature could be de/re-activated either at the beginning or the end.
Apr 25 2023 12:22 PM