Solved

Value does not fall within expected range error

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
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)

775 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