Solved

Value does not fall within expected range error

Posted on 2013-06-08
4
1,199 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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…

708 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

17 Experts available now in Live!

Get 1:1 Help Now