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!
I really love using regular expressions.
It’s so easy to check strings… for example if you want only alphanumeric or only numbers or a very specific format like two letters, one point, one number and a #, in the specific order.
In my opinion, it’s highly difficult to create the reg exp from scratch.
I have found a very good shareware program which build and test them for me. You can find it here.
Once you have your regular expression, how can you use it in your code?
Let’s say you just need to check if a string is composed only by alphanumeric chars.
Here’s a bit of C# code:
string mystring = “HELLO”;
string regExpString = “^\\w+$”;
if (System.Text.RegularExpressions.Regex.IsMatch( mystring , regExpString))
//here mystring contains only alphanumerics
else
// here mystring contains also something else
So… isn’t it easy?
Just a small tip that will help you to avoid to loose half a day looking for a solution…
When using Sharepoint throught web services remember to set the WEB REFERENCE to the right website.
If you have to access the main website point to http://<typehereyourdomain>/_vti_bin/lists.aspx but if you need to work on a subsite, remember that you have to point to the right web service, i.e. http://<typehereyourdomain>/<typehereyoursubsite>/_vti_bin/lists.aspx.
Finally I did it!
I just moved to Wordpress and I am already so enthusiastic! So many interesting features for a free and fast CMS.
After some years working on a self-made CMS, which I could not update anymore, as I had no time, I jumped last year on the Blogger platform.
I realised quite immediately that there were strong limitations and I was too linked to the blogger website, even if working on my own domain.
Here the decision to move on wordpress.
What do I like from Wordpress?
It is light, fast, very easy to customise, and uptodate.