trouble with SharePointUtilities.dll

Mar 24, 2009 at 1:23 AM

I am looking forward to using the SSIS adapters once we have sql 2008 deployed. Until then, I wanted to get something deployed, so I tried to write C# against the SharePointUtility.dll. I figured out how to call the ListServiceUtility.GetListItemData() and ListServiceUtility.UpdateListItems() methods from SharePointUtilities.dll, but I’m having a few problems:

 

·         GetListItemData() – It will return most of the columns I specify, but not a custom column named “FirstName”, nor the system columns named “Created By” or “Modified By”. This is how I'm defining my field list:  List<string> fieldNames = new List<string>() {"EEID","FirstName","LastName","MiddleInitial","LocationName","GroupName1","CompanyName","PreferredName","Created By","ModifiedBy"};

 

 

·         UpdateListItems() – Instead of updating an existing record, it inserts a new one. Seem like a primary key needs to be specified, but it’s unclear how I would do that. The Dictionary list contains all the columns mentioned above, less the 3 missing ones.  

 

What am I missing?

 

 

Coordinator
Mar 24, 2009 at 2:35 PM
Edited Mar 24, 2009 at 10:21 PM
For the update, you need to provide the ID of the row to update

For the columns, call the function which gets the columns from the target list and look at the fields that come back to figure out what you should call it on the get or update.

Sharepoint stamps the name of the column to when you first create it. So if you name a column FirstNameOfPerson, then rename it for visual display to FirstName, it's still called FirstNameOfPerson.
Mar 24, 2009 at 8:03 PM
that explains my problems! thank you.