1

Select() with strange behaviour in Ninox Cloud 3.18.x release

The bug can also be replicated in other previous releases.

I've created a page in order to implement a custom filter, using the value of different fields. The final design is something like this:

 Now, in order to count the found items (and to display them) I use a formula like this one:

let productos := this;
let products := (select Folletos
        where (not productos.Nuevo or number(Estado) = 1) and
                    (not productos.'Con imagen' or Imagen != null) and
                (productos.'Sección' = null or productos.'Sección' = "" or
                    text('Sección') = text(productos.'Sección')) and
            (productos.Folleto = null or productos.Folleto = "" or
                Folleto = text(productos.Folleto)) and
        (productos.'Descripción' = null or productos.'Descripción' = "" or
                contains(lower('Descripción'), lower(productos.'Descripción')) or
            contains(lower('Descripción - Manual'), lower(productos.'Descripción'))));
text(cnt(products)) + " productos"

 

 

This select refers to the table Folletos.  Interenstingly, if then I navigate to that table (Folletos) the Ninox interface behaves in a strange way: the edits are not "sticky", i.e, if I edit the value of a text field or a drop down menu, it behaves in a strange way, it does not display the entire value list or, worst, when refreshing the page, all the edits are lost.

I can edit any value of the Folletos table, but if I open the Page (with the above formula) then the app is again corrupted. I can restore the correct behaviour refreshing the page.

What's going on? What is doing that select? Maybe too cumbersome? (NOTE: in my test environtment, the Folletos table has only 3 records)

1 reply

null
    • Consultant and developer
    • Javier
    • 4 hrs ago
    • Reported - view

    I've found the solution! I needed to use another, maybe easier, syntax:

    let t := this;
    let myRecordSet := (select Folletos);
    if t.'Descripción' != "" and t.'Descripción' != null then
        myRecordSet := myRecordSet[contains(lower('Descripción'), lower(t.'Descripción'))]
    end;
    if t.'Sección' != "" and t.'Sección' != null then
        myRecordSet := myRecordSet[text('Sección') = text(t.'Sección')]
    end;
    if t.Folleto != "" and t.Folleto != null then
        myRecordSet := myRecordSet[text(Folleto) = text(t.Folleto)]
    end;
    if t.Estado != null then
        myRecordSet := myRecordSet[text(Estado) = text(t.Estado)]
    end;
    if t.'Sin imagen' = 1 then
        myRecordSet := myRecordSet[Imagen = null and 'Imagen - Manual' = null]
    end;
    cnt(myRecordSet) + " productos"
    

Content aside

  • Status Answered
  • 1 Likes
  • 4 hrs agoLast active
  • 1Replies
  • 10Views
  • 1 Following