How do I query a SharePoint List using a url and filtering on date?

I am reading a SharePoint list using jquery.  Everything is working fine
except for the filter.  Each list item has an expiration date.  I want to retrieve JUST the items that have not expired (Expires > Today) but I can't figure out the url syntax and I've been searching all day for an example and
can't find one.  Could someone please help?!?  See bold code below.
Thanks,
Glen
$(document).ready(function ()
<strong>var qryWCFUrl = "/sites/MMTP1/_vti_bin/listdata.svc/MMAlerts?$filter=(Expires gt '08/10/2011')&$orderby=Title";
</strong> $.getJSON(qryWCFUrl, function (results)
$.each(results.d.results, function (i, mmAlert)
itemID = mmAlert.Id;
mmTitle = mmAlert.Title;
mmClass = mmAlert.ClassValue;
//alert("Item="+itemID+" Title="+mmTitle+" Class="+mmClass);
AddMMStatus(mmAlert.Id,mmAlert.Title,mmAlert.ClassValue);

Fadi,
Thanks for your response.  I actually have another version of the code that uses the SP client objects that works.  The problem is site boundries.  Let me give a more complete project explanation.
I am creating a master page for a new intranet.  As part of this master page, I want to read from an SP list of alerts and post each alert (if not expired) in the SP status bar.  I've gotten this to work with SP client objects and jquery (except
for the date filter part).  Both of these solutions work fine on the top site level.  BUT when trying it out at the sub-site level, the SP client objects version of my code fails. The jQuery version works except the date filtering.
I looked at the example from your link and it looks like a bit of a hybrid to my approaches:  JQuery with CAML.  My question is; does this example permit me to access a list in the top-level site from the subsites?  Please excuse my ignorance,
but I am an EXTREME newbie in this having spent the past 8 years as a VB.Net developer and a little bit of ASP.Net.
Below are the two different versions of my code in different versions of my master page definition:
SP Client Object Version
<script type="text/javascript">
// <![CDATA[
ExecuteOrDelayUntilScriptLoaded(LoadAlerts, "sp.js");
var ctx;
var currAlerts;
function LoadAlerts() {
ctx = new SP.ClientContext.get_current();
list = ctx.get_web().get_lists('/sites/MMTP1/Lists/').getByTitle('MMAlerts');
var cmlQry = new SP.CamlQuery();
var camlExp = '<query><Query><Where><Gt><FieldRef Name="Expires" /><Value IncludeTimeValue="FALSE" Type="DateTime"><Today /></Value></Gt></Where></Query></query>';
cmlQry.set_viewXml(camlExp);
currAlerts = list.getItems(cmlQry);
ctx.load(currAlerts,'Include(ID,Title,Class)');
ctx.executeQueryAsync(GetAlertsSuccess,GetAlertsFailed);
function GetAlertsSuccess() {
var lstEnum = currAlerts.getEnumerator();
while(lstEnum.moveNext()) {
var mmAlert = lstEnum.get_current();
AddMMStatus(mmAlert.get_item('ID'),mmAlert.get_item('Title'),mmAlert.get_item('Class'));
function GetAlertsFailed(sender,args) {
alert('Alerts load failed: ' + args.tostring);
function AddMMStatus(msgID, strTitle, strClass) {
var statID;
var statClass;
var statTitle;
statClass = "<a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strClass + ": </a>";
statTitle = "<a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strTitle + "</a>";
statID = SP.UI.Status.addStatus(statClass, statTitle, true);
SP.UI.Status.setStatusPriColor(statID,"red");
function DisplayAlert(msgID) {
var options = {
title: "Miller & Martin Alert!",
url: "/sites/MMTP1/SitePages/ShowAlert02.aspx?ID="+msgID,
allowMaximize: false,
showClose: true
SP.UI.ModalDialog.showModalDialog(options);
// ]]>
</script>
JQuery Version (works except for filtering by date)
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" >
// <![CDATA[
var itemID;
var mmTitle;
var mmClass;
$(document).ready(function ()
var qryWCFUrl = "/sites/MMTP1/_vti_bin/listdata.svc/MMAlerts?$filter=(Expires gt '08/10/2011')&$orderby=Title";
$.getJSON(qryWCFUrl, function (results)
$.each(results.d.results, function (i, mmAlert)
itemID = mmAlert.Id;
mmTitle = mmAlert.Title;
mmClass = mmAlert.ClassValue;
AddMMStatus(mmAlert.Id,mmAlert.Title,mmAlert.ClassValue);
function AddMMStatus(msgID, strTitle, strClass, strSeverity) {
var statID;
var statClass;
var statTitle;
statClass = "<div id=\"mmAlertTitle\" style=\"display:inline-block;\"><a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strClass + ": </a></div>";
statTitle = "<div id=\"mmAlertDetail\" style=\"display:inline-block;\"><a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strTitle + "</a></div>";
statID = SP.UI.Status.addStatus(statClass, statTitle, true);
SP.UI.Status.setStatusPriColor(statID,"green");
function DisplayAlert(msgID) {
var options = {
title: "Miller & Martin Alert!",
url: "/sites/MMTP1/SitePages/ShowAlert02.aspx?ID="+msgID,
allowMaximize: false,
showClose: true
SP.UI.ModalDialog.showModalDialog(options);
// ]]>
</script>

Similar Messages

  • How to Enable Ratings on SharePoint List using Client Object Model for Office 365 SharePoint Site.

    How to Enable Ratings on SharePoint List using Client Object Model code for Office 365 SharePoint Site.
    Thanks in Advance
    Rajendra K

    Hi Rajendra,
    here you are the code and the blog, let me know if this helps
    using (ClientContext ctx = new ClientContext(https://yourSiteUrl))
    Web w = ctx.Web;
    List l = w.Lists.GetByTitle("yourListName");
    ctx.Load(l, info => info.Id);
    ctx.ExecuteQuery();
    string ListID = l.Id.ToString();
    Microsoft.Office.Server.ReputationModel.Reputation.SetRating(ctx, ListID, 1, 5);
    ctx.ExecuteQuery();
    http://blogs.technet.com/b/speschka/archive/2013/07/08/how-to-use-csom-with-ratings-in-sharepoint-2013.aspx
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • How to update an existing item in a sharepoint list using the WSS adapter for Biztalk

    Is there a way that a record in SP list be updated using WSS adapter in biztalk ?
    BizTalk 2013 and SP 2013 ..
    Regards
    Ritu Raj
    When you see answers and helpful posts,
    please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    A ListItem has its own unique row id so in all likelihood, an insert with the same data will result in a new list entry. The Lists Web Service however, has an UpdateListItem method which will take an update request. [refer
    http://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.15).aspx ]
    There is another note in the conference (marked answered) to your List Item Update problem. Probably worth a try too. [refer
    http://social.msdn.microsoft.com/Forums/en-US/bee8f6c6-3259-4764-bafa-6689f5fd6ec9/how-to-update-an-existing-item-in-a-sharepoint-list-using-the-wss-adapter-for-biztalk?forum=biztalkgeneral ]
    Regards.

  • SSRS reporting with sharepoint list using Distinct and Multivalue parameters

    i want create ssrs report with sharepoint list using ms-vs(2008). i want create Distinct multivalue parameters by using CAML query. There is any way we put CAML query where we use Distinct keyword and IN clause in CAML query... i hope all experts will
    understand my poor English... sorry for poor English.. plz help me

    Hi AsifMehmood,
    Per my understanding you have create an SSRS report with SharePoint list, now you don’t know to create the distinct parameters by using CAML query,  right?
    For the CAML language doesn’t have any reserved word (or tag) to set this particular filter to remove duplicate results, but we can use the custom code to do this function. I have tested on my local environment and we can do that by create one hidden parameter(Param1)
    to get all the values from the fields which will  add the filter and then create another parameter(Param2) to get the distinct values based on the Param1, we use the custom code to do the deduplication.
    Step by Steps information in below thread for your reference to create the parameters and the custom code:
    "How to get distinct values of sharepoint column using SSRS"
    Other similar thread for your reference:
    https://audministrator.wordpress.com/2014/02/17/sharepoint-list-add-distinct-parameter-value/
    If your problem still exists, please feel free to ask and also try to provide us more details information.
    Regards
    Vicky Liu

  • Help with Joining two SharePoint lists using LINQ

    Hi Guys,
    I have found many threads with this question. Although I had one doubt. I wanted to know that while performing a Join operation on two SharePoint Lists using LINQ does the column on which we are performing the join operation need to be a Lookup column?
    I was initially using CAML but since my lists does not contain lookup columns I switched to LINQ but my doubt still remains.
    I would really appreciate any help from you guys and also would appreciate if I could get some examples that I could refer to.
    Thank you

    Joins in LINQ to SharePoint 2010
    How to: Query Using LINQ to SharePoint
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Get particular item count in sharepoint list using designer Workflow

    How to get specific item count in sharepoint list using designer Workflow 2013.
    For Example 
    Title  Count
    x        1
    y        1
    x        2
    x        3

    HI Thiru,
    Can you please elaborate your problem. Is that Title and count are your list columns you want to fetch the value of count column based on title?
    If my interpretation in not wrong, then it's not possible in SPD with the case you have mentioned in your question as Title='x' is having 3 different entries and SPD activity will always return first matching item and ignore the rest with warning message.
    Regards,
    Brij K

  • Split a text based on delimiter and add items to a sharepoint list using SPD workflow

    Hi All
    I have to store repeating table data into a sharepoint list. I have developed an approach to store data into a sharepoint list using web services as mentioned at
    http://www.bizsupportonline.net/infopath2007/how-to-submit-items-rows-repeating-table-infopath-sharepoint-list.htm. However this approach is working when form opened client only but when I opened it in browser this approach is giving error. Now I'm looking
    to promote repeating table data by combining items will a delimiter semi-colon (;). Please let me know how can I split the promoted field value using de-limiter and add it to a sharepoint list.
    Note:
    I'm working on SharePoint online 2010. (I don't have sharepoint on-premise, so I can't use SharePoint Object Model)
    If anybody know how to deal with this, please let me know.
    Thank you in advance.

    Hi Chuchendra,
    According to your description, my understanding is that you want to split the promoted field value in InfoPath form which was combined using semi-colon and add it to a SharePoint list.
    I recommend to submit the data to another SharePoint list first(use a column to store the value) and then create calculated columns to user formula to split the value, then use workflow to update the list where you want to add the value with the divided
    values.
    For example: the value is aa;bb;cc;dd.
    Based on the number of the semi-colons, we need to create one column to store the original value(named test for example), four calculated columns(v1,v2,v3,v4) to store the divided values and two more calculated columns(flag1,flag2) for use in the formula.
    v1: =LEFT([test],FIND(";",[test])-1)
    flag1: =RIGHT([test],LEN([test])-FIND(";",[test]))
    v2: =LEFT([flag1],FIND(";",[flag1])-1)
    flag2: =RIGHT([flag1],LEN([flag1])-FIND(";",[flag1]))
    v3: =LEFT([flag2],FIND(";",[flag2])-1)
    v4: =RIGHT([flag2],LEN([flag2])-FIND(";",[flag2]))
    We can also use Client Object Model to write code to split the value of the field.
    You can download the dll files form the link below:
    http://www.microsoft.com/en-in/download/details.aspx?id=21786
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • HT4489 How do I get my Contacts List onto my iCloud and my iPhone?

    How do I get my Contacts List onto my iCloud and my iPhone? My Contacts are on my Mac, but I can't get them synced onto my iPhone or iCloud?

    You're not signed into iCloud then.
    Go to System Preferences>iCloud and sign in, switch on any services you want to use. Your contacts will show up in Contacts and your appointments will be in Calendar. Enter new contacts/events etc in the respective app.
    Backup any content currently in Contacts and Calendars.

  • I need to play a song on a Keynote presentation, how do I do this ? I use to drag and drop the mp3 in Keynote but it stops playing when the slide move to the other one... how can I make the song keep playing through the whole presentation ? Thanks.

    I need to play a song in a row in a Keynote presentation, how do I do this ? I use to drag and drop the mp3 in Keynote but it stops playing when the slide move to the other one... how can I make the song keep playing through out the presentation ?
    Thanks.

    Drag the file into the audio window in the Document inspector...

  • How do I create an unordered list with three items and link to id's

    How do I create an ordered list with three items and linl to id's on my page

    Thanks, I guess what I was really asking, Is there a n option in the insert menu or somewhere where Dreamweaver does it for you.
    I am not clear on what you are wanting DW to do for you?  Is it that you want it to insert a three item unordered list?  No - there's no such function.  You would need to click in Design view where you want the list to go, click on the bulleted list icon on the Property inspector, and then enter the three items separated by carriage returns.  Then you'd have to link each item specifically.
    To enter the named anchors to element ID values, CS5 has no way to do this.  You'd have to enter those links manually.

  • How to upload a file into server using j2ee jsp and servlet with bean?

    How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
    Anyone help me please!

    u don't need j2ee and struts to do file uploading. An example is as such
    in JSP. u use the <input> file tag like
    <input type="file"....>You need a bean to capture the file contents like
    class FileUploadObj {
        private FormFile srcFile;
        private byte[] fileContent;
        // all the getter and setter methods
    }Then in the servlet, you process the file for uploading
        * The following loads the uploaded binary data into a byte Array.
        FileUploadObj form = new FileUploadObj();
        byte[] byteArr = null;
        if (form.signFile != null) {
            int filesize = form.srcFile.getFileSize();
            byteArr = new byte[filesize];
            ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
            bytein.read(byteArr);
            bytein.close();
            form.setFileContent(byteArr);
        // Write file content using Writer class into the destination file in the server.
        ...

  • HT1338 Yesterday, I purchased Mountain Lion OSX and tried to download it but I don't think it worked.  How can I tell if I am using Mountain Lion and how do I get help if the download was unsuccessful?

    Yesterday, I purchased Mountain Lion OSX and tried to download it but I don't think the download worked.  How can I tell if I am using Mountain Lion and how do I get help if the download was unsuccessful?

    Click your Apple menu icon top left corner of your screen.
    From the drop down menu click About This Mac.
    If Mountain Lion is installed, it will say:  v10.8
    If not, launch the App Store. From the App Store menu bar click Store > Check for Unfinished Downloads
    FYI ..  for downloading Mountain Lion from the App Store, a high speed (broadband) internet connection is strongly recommended by Apple as noted here > iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
    If you need to reinstall OS X or repair the the startup disk Mountain Lion Recovery, that requires broadband access to the internet via Wi-Fi or an Ethernet connection. OS X is downloaded over the internet form Apple when OS X Recovery is used for reinstallation.

  • When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    Does Firefox switch to full screen if you press F11 ?
    You can also try the F10 key to see if that brings up the menu bar.
    * If the above steps didn't help then see http://kb.mozillazine.org/Corrupt_localstore.rdf
    Note: Do not delete localstore.rdf in the program folder (Windows: "C:\Program Files\Mozilla Firefox\defaults\profile\") (Mac: "/Applications/Firefox.app/defaults/profile/")

  • Using Customize grouping and filtering for EPPM 8.2.1 family

    Are there any know issues or BUGS when using customize grouping and filtering returing more than the filtered projects?
    We are customizing grouping on Project Status and Region and filtering on Region and Let by Code
    Thanks

    Are there any know issues or BUGS when using customize grouping and filtering returing more than the filtered projects?
    We are customizing grouping on Project Status and Region and filtering on Region and Let by Code
    Thanks

  • How to access Sharepoint List using a Different user. Access SharePoint List using some Authentication

    Hi,
    SharePoint version 2010
    I am building an application in Java and would want to accesss a SharePoint List through REST. I have been trying to find out how the authentication process would work once i want to deploy it into Production. 
    I am not able to find anything useful to send user detail / authentication. Can you please help me out here.
    Thanks,
    Bhaskar.
    Thanks, Bhaskar

    Hi,
    According to your post, my understanding is that you want to access SharePoint list from Java application through REST.
     In some cases you may need to create a new access token (this is somewhat akin to "running as a different user").
    Essentially, you are using a different user's security context. Typically, you would create an Active Directory account specifically for this purpose and then grant appropriate rights to the user account in SharePoint.
    http://sharepoint.stackexchange.com/questions/83440/authenticate-external-systems-against-sharepoint-rest-services
    There are some articles about this topic, you can have a look at them.
    http://stackoverflow.com/questions/10722215/authenticating-to-sharepoint-with-kerberos-from-a-java-httpclient
    http://ctp-ms.blogspot.com/2012/12/interoperability-between-java-and.html
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

Maybe you are looking for

  • How to only sync selected items from library

    *I am a new owner of a 120GB iPod classic. How do I sync only certain songs from the itunes I currently have ? I removed the check mark from the box and those songs still downloaded to the ipod. Not sure how to set itunes to only snyc those items sel

  • Share bluetooth device?

    I am creating an installation using 5 Mac Minis all ethernet networked together (LAN)together and all bluetooth-equipped. I was hoping that they could share a single Mac bluetooth keyboard and mouse (i.e. when in range of one, say Mini 1, I could con

  • Terminated by signal SIGSEGV (Address boundary error)

    Hi, I was doing a bit of multitasking, and the kernel ran out of SWAP and crashed. After reboot everything is borked. Every program I had open prior to crash wont start or crashes soon after opening. (Chromium, Clementine, Terminal, Smuxi, VMware...)

  • HOW TO ADD DETAILS TO MULTIPLE TABLE(its urgent)

    Hi All, I have created one table called employee_master which records all the details of employee. The problem which i am facing is if the employee wants to update the details then it is over writing the original record in the master table. what i wa

  • All the adobe products crashes beacuse of Adobe Application Manager

    Ever since I downloaded trial version Adobe after effects through Creative Cloud, all my other other licensed products like Photoshop, Captivate, Flash crashes everytime I try to open them. Every day I have to install them. Its really frustrating. Th