0

Issue with Formula for Clearing Data in Ninox

Hello everyone!

I've encountered a problem while creating a formula for my Ninox database. I have a button that creates a new day based on the previous one, and I want the process to include clearing data in the 'FILL/CREDIT' table.

Here's my current formula:

let x := dialog("NEW DAY TEMPLATE", "Do you want to create a template for the next day?", ["No", "Yes"]);
if x = "Yes" then
    let c := duplicate(this);
    let t := this;
    c.DATE := t.DATE + 1;
    c.'EXCHANGE RATES' := true;

    // Clear data from 'FILL/CREDIT' table
    for record in c.'FILL/CREDIT' do
        deleteRecord(record);
    end

openRecord(c);
en

However, I'm encountering errors when executing this formula. The errors include:

  1. Expression expected: at Line 8, column 6
  2. Invalid operator: void / void at line 8, column 6
  3. Field not found: clear at line 8, column 12
  4. Invalid operator: void / void at Line 8, column 17
  5. End expected: Data at Line 8, column 17

Perhaps I'm making some mistakes in syntax or logic. I'd appreciate it if someone experienced with Ninox could help me understand and resolve this issue.

Thank you in advance for your assistance!

Best regards

2 replies

null
    • John_Halls
    • 1 yr ago
    • Reported - view

    Hi

    I'm not sure you need this bit of code at all

    // Clear data from 'FILL/CREDIT' table
        for record in c.'FILL/CREDIT' do
            deleteRecord(record);
        end
    

    Duplicating a record does not duplicate the related data.

    If you find you do need to delete the related data, try this

    delete c.'FILL/CREDIT'

    Regards John

      • iliper LTD
      • iliper_LTD
      • 1 yr ago
      • Reported - view

       Thanks John )

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 2Replies
  • 80Views
  • 2 Following