Solved

Value does not fall within expected range error

Posted on 2013-06-08
4
1,227 Views
Last Modified: 2013-06-08
Hi All,
I am using SharePoint 2010

This is driving me crazy. Does anyone know why I get the following error:
error
Here's the code:
function GetCurrentResult(measureTitle,fy,qtr)
	{		
	alert("Current Result Function measure title:"+measureTitle);
	alert("FY"+fy);
		$().SPServices({
			operation: "GetListItems",
			async: false,
			listName: "Current Results List",
			//CAMLViewFields: "<ViewFields><ViewFields/>",
			CAMLQuery:"<Query><Where><Eq><FieldRef Name='MeasureID' /><value Type='Text'>"+measureTitle+"</value></Eq></Where></Query>",
			  completefunc: function (xData, Status) {
			  alert(xData.responseXML.xml);
			  $(xData.responseXML).SPFilterNode("z:row").each(function(){   
   
					//var currResult = $(this).attr("ows_CurrentResultQtr"+qtr);
					var currResult = $(this).attr("ows_CurrentResultQtr"+fy);
					alert("CurrResult: "+currResult);
			  });	
		 }
		});

}

Open in new window

0
Comment
Question by:Isaac
  • 2
  • 2
4 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 39232154
Hi,
this error normally occurs if a FieldRef with this name does not exists. Can you please double check, if the internal name of the field is really "MeasureID"?
Perhaps you might attach the List schema XML (as you have done in another questions):
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/Q_28134367.html#a39185813

HTH
Rainer
0
 
LVL 5

Author Comment

by:Isaac
ID: 39232164
Ok.  That is the problem.  I thought the display name is used when it comes to the FieldRef and not internal name.
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39232183
I do this for more than 10 years now, and still I have to recap each and every time where I have to use the Display name and where the Internal name.
0
 
LVL 5

Author Comment

by:Isaac
ID: 39232188
Thanks!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now