All posts tagged SPView

SharePoint – SPView: Exception calling “Add” with “6” argument(s): “An error occurred while parsing EntityName.

Error occurred while parsing EntityName.

So had an issue today.  We were migrating data into SharePoint and once that was complete we had a request from the client to build a set of views based on a lookup list.  So out comes the old trusty PowerShell script ISE and I started plugging away at the code.  When the script was complete I ran it in the test environment where the data was contained.  When the script ran the add on the SPView collection the script stalled with error: “Exception calling “Add” with “6” argument(s): “An error occurred while parsing EntityName.”  Well that error is really easy to under stand.

Read more

Build Views on the Fly When Gathering Data from SharePoint

So recently at my client site we had a report that was running incredibly long.  This was a while ago, so unfortunately I can’t remember the run time, but I believe it was greater than 12 hours.  The report was pretty basic, just a determination of which documents were created within the month and an output that displayed things like location, file name, created date and creator.

When reviewing the code I noticed the original solution had been coded to loop through each site in the web and then grab all the documents within a particular date range.  The line in particular that scanned the documents was as follows:


[code language=”csharp”]
var listAddedItems = listItems.Where(x => ((DateTime)x["Created"] >= reportManager.ReportStartDate && (DateTime)x["Created"] <= reportManager.ReportEndDate) || ((DateTime)x["Modified"] >= reportManager.ReportStartDate && (DateTime)x["Modified"] <= reportManager.ReportEndDate));

Pretty straight forward, but what it’s actually doing is going through and gathering all the data and throwing out what you don’t need.  Not a big deal unless you are working with a lot of data.  Right now we are sitting at around 1 million items in our SP farm.  I think I found the culprit.

Read more