0

Substitutions for ui.popupRecord

Hi all -

What are the other solutions to ui.popupRecord? Ninox said back in v3.8 that it, and a bunch of other commands, are being depreciated. Though it hasn't yet.

I've seen urlOf but that is like openRecord. I need something that just does popup.

10 replies

null
    • Ninox developper
    • Jacques_TUR
    • 3 wk ago
    • Reported - view

    In what context do you use the popupRecord function? Can you show the JS code you use?

      • Fred
      • 3 wk ago
      • Reported - view

      More specific I'm asking about ui.popupRecord(). So if I'm making a HTML table I can make button that popups a record. I'm asking for other options to ui.popupRecord() since Ninox says they are deprecating it.

      • Ninox partner
      • RoSoft_Steven.1
      • 3 wk ago
      • Reported - view

       These claims date back to 2023. I think Ninox has abandoned these plans because their new CRM (for the private cloud, with modularity) also uses this....

      • Sviluppatore Ninox
      • Fabio
      • 2 wk ago
      • Reported - view

       
       

      That's actually what it looks like given the integrations in the modular CRM. Although, this message still appears from the console when you make use of it:

      This database is trying to access an internal API: ui.popupRecord. Future versions of Ninox will not support this operation.

      We'll see...

      Fabio

    • Ninox developper
    • Jacques_TUR
    • 2 wk ago
    • Reported - view

    You could also do this using Ninox script. With Ninext, you can call a Ninox function from JavaScript, pass parameters to it, and retrieve its return value. This means you could use Ninox's popupRecord directly without going through ui.popupRecord.

    I’ve included several examples in the NinoxCallBack form of the Ninext2.1 application as an attachment.

     

    Here is the script that is in the formula 'Show valuer after input'.

    ---
    Function called by the input element when it loses focus.
    ---;
    function onblur(inputValue : text) do
        alert(---
    Input of record { this.Id } is { inputValue }
        ---)
    end;
    ---
    The HTML input element has an ID composed of myInput followed by the ID of the current record. This ensures that, in case of multiple overlapping forms, this specific element can be identified.
    The onblur event calls the ninext.callNinocFunction function.
    The first parameter is the name of the Ninox function to call.
    The second is the ID of the HTML element. This ID allows ninext to locate the corresponding formula and identify the Ninox function inside it.
    The following parameters are those to be passed to the function when called. Here, we passed the input field value to display it.
    ---;
    html(---
        <input id="myInput{ this.Id }"
                class="nx-input nx-input--editing"
                style="width: 100%; height: 100%;"
                onblur="ninext.callNinoxFunction('onblur', this.id, this.value )">
            My button
        </button>
    ---)
    

     #Ninext 2-1.ninox

    • Fred
    • 2 wk ago
    • Reported - view

    Ninox has responded and the deprecation was only for global variables. Which I guess is what it actually says. :)

    • Rafael Sanchis
    • Rafael_Sanchis
    • 2 wk ago
    • Reported - view

    I have problem here,  Somw idea        onclick = ui.popupRecord('{ recordId }')" 

     

    let recordId := text(raw(l));
        "<tr " +
        ---
            onclick = ui.popupRecord('{ recordId }')"
        --- +
        ">
            <td " +
        ---
            onclick = ui.popupRecord('{ recordId }')"
        --- +
        "><span class='status " +
        statusClass +
        "'>" +
        switch l.Format do
        case 1:
            "CD"
        case 2:
            "CD'2"
        case 3:
            "CD'3"
        case 4:
            "CD & DVD"
        case 5:
            "CD's Box"
        default:
            "Unknown"
        end +
        "</span></td>
            <td " +
        ---
            onclick = ui.popupRecord('{ recordId }')"
        --- +
        ">" +
        l.Name +
        "</td>
            <td " +
        ---
            onclick = ui.popupRecord('{ recordId }')"
        --- +
        ">" +
        l.Title +
        "</td>
    
      • Fred
      • 2 wk ago
      • Reported - view

      I don't think you need both text() and raw() in the recordId variable.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 2 wk ago
      • Reported - view

       

      Hi Fred It doesn't work either 

      let recordId := l;
      • Fred
      • 2 wk ago
      • Reported - view

      Yes, I was wrong. You can add back the raw(). Paul posted working code in his post. First time I've seen three dashes inside double quotes. Fun.

      Try:

      onclick = "ui.popupRecord('{ recordId }')"

      You were missing the first double quote in front of ui