0

Trigger on create with numeric fields

I am creating a table from another table with trigger on create with this code.

let a := Factura.Cliente.Cliente;
let b := Empresa;
let c := Monto
let d := Fecha
let p := (create Flujo);
p.('Cliente / Proveedor' := a);
p.(Empresa := b);
p.(Concepto := "Ingresos");
p.('Monto Prov' := c);
p.(Fecha := d)

It works for all text fields but not for numeric fields like date and amount.

Please help.

10 replies

null
    • Fred
    • 6 hrs ago
    • Reported - view

    Just to verify that Monto and 'Monto Prov' are actual number fields and Fecha in both tables are date fields.

      • Mario_Cuzzi
      • 5 hrs ago
      • Reported - view

       That's right, Fred.

    • John_Halls
    • 5 hrs ago
    • Reported - view

    There are a couple of missing semi-colons in your code

    let c := Monto
    let d := Fecha

     regards John

      • Mario_Cuzzi
      • 5 hrs ago
      • Reported - view

       

      Thanks John.
      It doesn't work either
      It works in
      let b := Company;
      I assume it's because it's a text field.

    • Fred
    • 5 hrs ago
    • Reported - view

    Can you post a sample DB?

    • Mario_Cuzzi
    • 4 hrs ago
    • Reported - view

    This is my original table

    It has the following trigger

    I get the following result

    What am I doing wrong?

      • Fred
      • 4 hrs ago
      • Reported - view

       can you post screenshots of the edit fields  window for each table?

    • Mario_Cuzzi
    • 4 hrs ago
    • Reported - view

    Sure.

    Thank you very much for your help.

    • szormpas
    • 3 hrs ago
    • Reported - view

     Hi,

    I think the issue arises because you have put your code inside the 'Trigger on new record'.

    Ninox runs your code instantly when you create a new record on the Table Facturado before you have the time to enter any values on the new record fields.

    • szormpas
    • 3 hrs ago
    • Reported - view

     I suggest to put your code inside the 'Triger after update'.

Content aside

  • 3 hrs agoLast active
  • 10Replies
  • 17Views
  • 4 Following