Cannot set properties of undefined (setting 'FServerRecordCount')

Hello!

After a recent upgrade od Webcore I get this error in my code (upgrade is not necessary the culprit, but could be related):

Cannot set properties of undefined (setting 'FServerRecordCount')

If I put the OData in a browser, I get a normal JSON resutl, but in the application I get the mentioned error:

The code is simple:

  wdsPranje.Close;
  wdsPranje.QueryString := '$filter=Id eq '+FNalogId.ToString+' and Lokacija/Aktivna ne 0&$top=1&$expand=Lokacija,Lokacija/Stranka,Vozilo,Vozilo/TipVozila';
  modMain.Log(wdsPranje.QueryString);

I tried without the expand commands and the result is the same.

I would need some help here :slight_smile:

Can you give somewhat more context.
We searched on FServerRecordCount, but there is nothing like this in the entire TMS WEB Core framework itself.
So, can you please inform what FServerRecordCount is related to and what exactly is happening when this error occurs? Did you inspect the browser console to see the stack trace?

First - I copy pasted too little - on the end is missing

wdsPranje.Load;

The error is exactly in the unit:

Here's the exception stack in the browser's dev console

XData.Web.Dataset.pas:113
 Uncaught TypeError: Cannot set properties of undefined (setting 'FServerRecordCount')
    at Object.OnSuccess (XData.Web.Dataset.pas:113:5)
    at cb (rtl_2025_4_169.js:256:1)
    at Object.DoLoad (XData.Web.Client.pas:360:9)
    at LocalSuccess (XData.Web.Client.pas:517:9)
    at LocalSuccess (XData.Web.Connection.pas:449:7)
    at XMLHttpRequest.XhrLoad (XData.Web.Connection.pas:180:7)

The problem is in the unit XData.Web.Dataset precisely in the procedure below:

procedure TXDataDataRequest.OnSuccess(Resp: TXDataClientResponse);
begin
  if (Resp.StatusCode = 200) then
  begin
    TXDataDataProxy(DataProxy).FDataset.FServerRecordCount := Resp.Count; <-- Exception here
    Data := Resp.Result;
    if isArray(Data) then

Hope it helps

Kind regards

Here's the OData request

http://localhost:2001/kamijoncin/NalogPranje?$filter=Id eq 1 and Lokacija/Aktivna ne 0&$top=1&$expand=Lokacija,Lokacija/Stranka,Vozilo,Vozilo/TipVozila,Posode,Posode/Posoda

and the result in the browser:

{
  "value": [
    {
      "$id": 1,
      "Id": 1,
      "CasPranja": "2026-06-17T13:03:14",
      "PodpisStranke@xdata.proxy": "NalogPranje(1)/PodpisStranke",
      "Opombe": "test",
      "Naslov": "EO Fiesa",
      "Lat": 45.5231018066406,
      "Lon": 13.582200050354,
      "PotId": null,
      "Lokacija": {
        "$id": 2,
        "Id": 6,
        "Aktivna": true,
        "Naziv": "EO Fiesa",
        "Opombe": "",
        "Lat": 45.5231146295349,
        "Lon": 13.5822062939789,
        "AktivnaOd": null,
        "AktivnaDo": null,
        "TehtnicaKoda": null,
        "InterneOpombe": null,
        "Stranka": {
          "$id": 3,
          "Id": 166,
          "ZunanjaOznaka": "občina",
          "TehtnicaKoda": null,
          "Aktivna": true,
          "Obracun": true,
          "Naziv": "Občina Piran",
          "Naslov": "",
          "Posta": "",
          "Kraj": "",
          "DavSt": "",
          "Tel": "",
          "Opombe": "",
          "MesecniObracun": true,
          "Email": null,
          "Geslo": null,
          "InterneOpombe": null,
          "Lokacije@xdata.proxy": "Stranka(166)/Lokacije"
        },
        "Odvozi@xdata.proxy": "Lokacija(6)/Odvozi",
        "Posode@xdata.proxy": "Lokacija(6)/Posode"
      },
      "Vozilo": {
        "$id": 4,
        "Id": 1,
        "RegistrskaSt": "KP TEST",
        "Aktivno": true,
        "Letnik": null,
        "PrvaRegistracija": null,
        "Znamka": "OKOLJE",
        "Tip": "FIKTIVNO VOZILO",
        "MocKW": null,
        "Prostornina": null,
        "StSasije": null,
        "MasaVozila": null,
        "MasaNajvecja": null,
        "PrtljaznikVolM3": null,
        "Opombe": "Za testiranje",
        "StanjeKm": 0,
        "TipVozila": {
          "$id": 5,
          "Id": 5,
          "Opis": "Pralec"
        },
        "VrstaOdvoza@xdata.proxy": "Vozilo(1)/VrstaOdvoza",
        "Odvozi@xdata.proxy": "Vozilo(1)/Odvozi"
      },
      "Voznik": null,
      "Status@xdata.proxy": "NalogPranje(1)/Status",
      "Stranka@xdata.proxy": "NalogPranje(1)/Stranka",
      "Posode": [
        {
          "$id": 6,
          "Id": 6,
          "Kolicina": 1,
          "Nalog@xdata.proxy": "NalogPranjePodrobno(6)/Nalog",
          "Posoda": {
            "$id": 7,
            "Id": 2,
            "Idx": 2,
            "Opis": "MKO 240",
            "VolumenPosode": 0.24,
            "TezaPosode": 240,
            "Aktivna": -1,
            "Frakcija@xdata.proxy": "Posoda(2)/Frakcija"
          }
        },
        {
          "$id": 8,
          "Id": 7,
          "Kolicina": 1,
          "Nalog@xdata.proxy": "NalogPranjePodrobno(7)/Nalog",
          "Posoda": {
            "$id": 9,
            "Id": 16,
            "Idx": 6,
            "Opis": "MKO 1100",
            "VolumenPosode": 1.1,
            "TezaPosode": 1100,
            "Aktivna": -1,
            "Frakcija@xdata.proxy": "Posoda(16)/Frakcija"
          }
        },
        {
          "$id": 10,
          "Id": 8,
          "Kolicina": 1,
          "Nalog@xdata.proxy": "NalogPranjePodrobno(8)/Nalog",
          "Posoda": {
            "$id": 11,
            "Id": 5,
            "Idx": 14,
            "Opis": "M. EMB. 240",
            "VolumenPosode": 0.24,
            "TezaPosode": 240,
            "Aktivna": -1,
            "Frakcija@xdata.proxy": "Posoda(5)/Frakcija"
          }
        },
        {
          "$id": 12,
          "Id": 9,
          "Kolicina": 1,
          "Nalog@xdata.proxy": "NalogPranjePodrobno(9)/Nalog",
          "Posoda": {
            "$id": 13,
            "Id": 6,
            "Idx": 20,
            "Opis": "M. EMB. 1100",
            "VolumenPosode": 1.1,
            "TezaPosode": 1100,
            "Aktivna": -1,
            "Frakcija@xdata.proxy": "Posoda(6)/Frakcija"
          }
        },
        {
          "$id": 14,
          "Id": 10,
          "Kolicina": 1,
          "Nalog@xdata.proxy": "NalogPranjePodrobno(10)/Nalog",
          "Posoda": {
            "$id": 15,
            "Id": 8,
            "Idx": 5,
            "Opis": "PAPIR 240",
            "VolumenPosode": 0.24,
            "TezaPosode": 240,
            "Aktivna": -1,
            "Frakcija@xdata.proxy": "Posoda(8)/Frakcija"
          }
        },
        {
          "$id": 16,
          "Id": 11,
          "Kolicina": 1,
          "Nalog@xdata.proxy": "NalogPranjePodrobno(11)/Nalog",
          "Posoda": {
            "$id": 17,
            "Id": 15,
            "Idx": 3,
            "Opis": "BIO 360",
            "VolumenPosode": 0.36,
            "TezaPosode": 360,
            "Aktivna": -1,
            "Frakcija@xdata.proxy": "Posoda(15)/Frakcija"
          }
        }
      ]
    }
  ]
}

So, what do you use to perform this OData request?

I use Bruno for XData testing: Getting Started - Bruno Docs

It looks a bit more complex problem, now I cannot compile te project anymore, it get stuck on the preprocessor part of the compiling. Other (Win32/64) projects do build normally, just the TMSWebCore doesn't.

I tried to clean the destination folder, the compiling cache... etc., but nothing works..

Please provide exact, defined and objective steps to reproduce the problem, or send a minimal sample project reproducing the issue.

Working on it, will report here soon