Cyberactiva WEB

Tuesday, February 26, 2008

SHAREPOINT: One of more field types are not installed properly

If you get this error while debugging your Sharepoint application, you have probably to know that you must call the fields with their INTERNAL NAME, which can be different from the name you see on labels on the site.

How can you find the correct internal name?
You can go to a page in which you have the possibility to edit all the fields and then look in the page source for the fieldname; otherwise you can also order a view by the specific field and then see what is written in the url.

I got this problem while trying to use the method UpdateListItems
in the lists.asmx Sharepoint webservices.
Here is the code I used:

XmlDocument doc = new XmlDocument();
XmlElement newFile = doc.CreateElement("Batch");
newFile.SetAttribute("OnError", "Return");

// as field name, we must pass the INTERNAL NAMES of the fields, example: Title is the internal name of the field Subject

newFile.InnerXml = "" +
"New" +
"" + NewName + "" + // Title is the internal name of Subject
"" + _client + "" +
"" + _listtype + "" + //internal name of List type
"" + _country + "" +
"" + _datext + "" +
"
";
XmlNode returnValue = WS.UpdateListItems("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", newFile);


Hope this will help you!

Labels:

Sunday, February 24, 2008

SHAREPOINT:The list that is referenced here no longer exists

Are you get this error while using the updatelistitems method in SHAREPOINT web service (list.asmx)?
Are you aiming to data stored in a subsite?
If so, the solution is to point the webservice of the subsite directly.
If your main site is http://cia, and your subsite is http://cia/coa, you should point to the webservice:

http://cia/coa/_vti_bin/list.asmx

Pay attention that, sometimes, when you update the webreference, in the app.config it remains the same. So change it there as well.

Good luck!

Labels: