Tuesday, November 27, 2007 2:23 AM
GetListItems and Custom Columns
Ok, well after getting my custom site columns, lists, referenced list columns for the site columns and all that created.
I now have the problem of actually accessing my data. I need to read all the list items (including my new columns) into an application and into a windows service on different machines, therefore since they are not on the same machine as Sharepoint I must use the web service Lists.asmx to do this along with the method GetListItems.
This seems fairly straightforward in that you build up appropiate xml parts to submit and then receive back the results as xml. However, it does not seem to read any of my custom columns except for one. Now, the following is the xml query parts that I submit to GetListItems....
<FieldRef Name="ResourceName" Ascending="FALSE"></FieldRef>
<FieldRef Name="ResourceName" />
<FieldRef Name="ResourceNetworkId" />
<FieldRef Name="ResourcePosition" />
<FieldRef Name="ResourceStandardRate" />
<FieldRef Name="ResourceType" />
<Paging ListItemCollectionPositionNext="0" />
I have checked all my field names to be correct by calling GetList and checking the list definition xml (which I wrote myself to generate the list anyway).
The column that works is ResourceName; now the only differences I can see are that ResourceName appears in the OrderBy, but having played with altering this, it makes no difference what field appears there. Also, the other difference is that ResourceName has been defined as the source for another field within the list definition, but I fail to see how this could make any difference.
I am very very stuck and this is painful to say the least, if anyone out there has any good ideas, please let me know as I can't stand this, I've been trying to make this work for the last 4 days and am getting nowhere fast. This is made more painful by the fact that after much searching and trawling of the internet I have been unable to find any information on doing anything other than using GetListItems with standard columns. Has anyone ever tried to do what I am doing? thankyou for reading this, I hope someone out there has an answer...... I'm off to the msdn forums to copy this post to there now..... :-)