Forum Discussion
Exception calling SPListCollection.Add: : Invalid field name. {1faa4902-9115-44b9-bba7-791441ca1d6f}
Hi Andrew van Renen,
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.
- Andrew van RenenMar 21, 2017Brass Contributor
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, 2017That explains things a bit. I think this is an out of the bix lookup to a document library. Could it be that the document library where the field was exported from was renamed? What is the base template of the template file?
- Andrew van RenenMar 22, 2017Brass ContributorIn the create list statement, I am using [Microsoft.SharePoint.SPListTemplateType]::GenericList as the template. It is the standard MS template for a custom list (not even a library). I am not adding any fields so it should just be creating a bog-standard custom list with just a Title field.