2

I have a problem, Im using SPservices on a site, and it works perfectly fine.

But when I access the site in a mobile phone, it doesn't work, JQuery works, just SPservices don't.

Its a pretty standard use of SPservices I believe

function updateMat(){
  var id = $("input[title='SolcDescItem']").val();
  //alert(id);
  var query = "<Query><Where><Eq><FieldRef Name='CatDescItem'/><Value Type='Text'>" + id + "</Value></Eq></Where></Query>"
  var marca, desc, serie, fam, formato, costoMuestra, candidad, subtotal;

  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "catItems",
    CAMLQuery: query,
    CAMLRowLimit: 1,
    completefunc: function (xData, Status) {
      var hasRows = false;
      $(xData.responseXML).find("z\\:row, row").each(function () {
        hasRows = true; 
        //valores
        serie = $(this).attr("ows_CatSerie");                 
        marca = $(this).attr("ows_CatMarca");
        desc = $(this).attr("ows_CatItem");
        fam = $(this).attr("ows_CatFam");
        formato = $(this).attr("ows_CatFormato");
        costoMuestra = $(this).attr("ows_CatCostoMuestra");    
      });
    }
  }); //spservices
  var cost = parseFloat(costoMuestra);
  cantidad = $("input[title='SolcCantidad']").val();
  subtotal = parseFloat(cantidad*cost);
  var multmult=Math.round(subtotal*100)/100;
  $("input[title='SolcSerie']").val(serie);
  $("input[title='SolcMarca']").val(marca);
  $("input[title='SolcFam']").val(fam);
  $("input[title='SolcFormato']").val(formato);
  $("input[title='SolcCostoMuestra']").val(cost);
  $("input[title='SolcItem']").val(desc);
  $("input[title='SolcSubtotal']").val(multmult);
}

What it does is retrieve information in a list "catItems" and assign it to variables, then I assign those values to SharePoint form fields.

I have tried differents (but not all) versions of SPservices, although I don't think it's a version issue.

Any insight? Anybody else having this problem?

Thanks in advance

Robbert
  • 6,481
  • 5
  • 35
  • 61
Martin
  • 21
  • 2
  • Is a windows phone able to pass NTLM credentials on to SharePoint? Or are you logging into SharePoint first? – Robbert May 19 '14 at 22:29
  • It is able to pass NTLM credentials on to SharePoint, otherwise it will give a Access Denied screen, since you have to be an authenticated user to access that site – Martin May 20 '14 at 13:59
  • What are the errors you're getting? – Robbert May 20 '14 at 14:02
  • It just doesn't work (The $().SPServices part), the values are not retrieved from the list "catItems" therefore the variables are empty and the SharePoint formfields are empty aswell, but they are retrieved when I test the site on my computer. – Martin May 20 '14 at 14:07
  • Does the function `updateMat` run at all? If it doesn't, you need to look at what's triggering that function. If it does, does the `completefunc` run? If it does, then what are the values of `xData.responseText` and `Status`? – Robbert May 20 '14 at 14:18
  • The function updateMat always runs since is triggered by a button. This is the value of xData.responseText on mobile: [MOBILE](http://imgur.com/56mzLvR) and this is the xData.responseText on my computer: [DESKTOP](http://imgur.com/WE4l5cH) Both status are shown as 'Success' – Martin May 20 '14 at 14:45
  • I have tracked the problem, `var id = $("input[title='SolcDescItem']").val();` is what I use as an ID and retrieve the fields from 'catItems' once the ID is found, but that field is a lookup column and it seems that on mobile its kinda broken, I'll get 'undefined' even though I can see every item in the lookup column, I'll try to make a workaround. Thx for the help – Martin May 20 '14 at 15:10

0 Answers0