0

Weird do as server issues

Hi all -

A button with a do as server use to work well, now I'm noticing that it doesn't do what it is supposed to do. If I remove the do as server it works fine, but really slow.

The button creates records then copies data from a formula field to a number field in the same record. The copying of data is the part that fails in a do as server. Once I remove the do as it works fine. I can't remove it as I have some large datasets that need to do this copying.

Even if I create a new button that just finds one record it doesn't do anything in a do as server.

I created an new test DB and was NOT able to reproduce it, so there is something up with my DB. Even if I upload a copy it still happens. Even across workgroups.

I tried do as transaction and that failed as well.

I have submitted a ticket with Ninox to see what they say. Andy at Nioxus says they are seeing the same issue. They find that do as transaction solves it for them. It doesn't for me.

I'll let you know what Ninox says.

3 replies

null
    • Mel_Charles
    • 3 wk ago
    • Reported - view

    Hmmm - Interesting 

    My do as server scripts are all working fine (web cloud version)

    Will be interesting to find out what is causing this.

    Might be worth uploading your button script here just in case?

      • Fred
      • 3 wk ago
      • Reported - view

      something as simple as (in the cloud):

      for statrec in atStats[level = "g"] do
          statrec.(
              historical := false;
              atm := statrec.latm;
              clears := statrec.lclears;
              ROLs := statrec.lROLs;
              penalties := statrec.lpenalties;
              DNFs := statrec.lDNFs
          )
      end

      does not work wrapped in do as server. The historical field gets set properly, but the other fields where I copy the data from latm, lclears, lROLs, etc do not get copies to their respective number field.

    • Fred
    • 2 wk ago
    • Reported - view

    Looks like it was my bad coding. 😗

    The formula field had code that was:

    length(ActiveTeams.TeamEventSummary.RoundAnalysis[round = t.round and
                    (var g := RiderIDs;
                        text(g) = text(t.riderIDArray))])
    

    That seem to cause problems. While the formula field showed the right data, when the button is clicked it seemed like it couldn't resolve this part of the code in time for the copying of data.

    So Ninox rewrote the code to:

    length(ActiveTeams.TeamEventSummary.RoundAnalysis[round = t.round and RiderIDs = text(t.riderIdArray)])
    

    I guess I was overthinking it. I thought that I needed to put the RiderIDs field into a variable because I thought it would return a large array but I guess I'm wrong.

Content aside

  • 2 wk agoLast active
  • 3Replies
  • 38Views
  • 2 Following