1

How can I modify this code so that it displays only the records where the title equals whatever the current title is of the current record I am in? Currently I get all the records from the second list.

function getFunding(){
`   var items = [{}];
`   var i = 0;
`  //Web Service
`$().SPServices ({
`      webURL: FundingWebURL,
`      operation: 'GetListItems',
`      listID: '{BB6490.......}',
`      async: false,
`      CAMLRowLimit:20,
`      CAMLViewFields: "<ViewFields>" +
`          "<FieldRef Name='ID' />" +
`          "<FieldRef Name='FRID' />" +
`          "<FieldRef Name='Title' />" +
`          "<FieldRef Name='Date' />" +
`          "<FieldRef Name="Amount' />" +
`      "</ViewFields>",

`CAMLQUERY:   
`  "<Query>" +
`     "<Where>" +
`        "<Eq>" +
`          "<FieldRef Name='Title' />" <Value Type='text'> </Value>" +
`         "</Eq>" +
`      "</Where>" +
`    "<OrderBy>"+
`        "<FieldRef Name='Title' Ascending='TRUE' />" +   
`    "</OrderBy>" +
`     "</Query>",
`completeFunc: function(xData, Status) {
`   //alert (xData.responseText);
`  $(xData.responseXML).SPFilterNode("z:row").each(function() {
`        items[i] = {
`            "Title" :   $(this).attr('ows_Title'),
`            "ID" :     $(this).attr('ows_ID'),
  `          "FRID" :     $(this).attr('ows_FRID'),                
`            "FY" :     $(this).attr('ows_Date'),
 `           "Amount" : $(this).attr('ows_Amount'),
`};
`i++;
`});
`}
`});// SP Services

`var itemsHTML="";
`
`for (var i=0; i < items.length; i++ ) {
` var value = "<table><tr>
`   <td width=100px>ID:" + items[i].ID +"  </td>
`   <td width=300px>Title: " + items[i].Title +" </td>
`   <td width=200px>FY: " + items[i].FY +"</td>
`   <td width=200px>Amount: " + Items[i].Amount +" </td>
`   </tr></table>";
`   value = value.replace("string;#","");
`   itemsHtml+= value + "<br/>";
`}
`itemsHtml+= "<br/><a href=https:/.........</a>"
`$("#Funding").html(itemsHtml);
`}
`

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.