0

Is it possible to link automatically (via a function) fields in two tables that contain the same text?

53replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • Captain Quint
    • Master and Commander of the Sea of Cortez
    • danberkey
    • 1 mth ago
    • Reported - view

    I'm a bit mystified.  This code compiles with no errors but doesn't work:

    let ShipsLogRecordID := Id;
    let StartDate := 'Log Start Date';
    let EndDate := 'Log End Date';
    for DeckLogRec in (select DeckLog)["Log Date" >= StartDate and "Log Date" <= EndDate] do
        DeckLogRec.(ShipsLogRef := ShipsLogRecordID)
    end

    The code is on a record level button in a table called ShipsLog.  The ShipsLog record has fields to specify a date range.  For every record in the DeckLog that falls within the date range specified by the fields in the ShipsLog, the code should set the ShipsLogRef (a reference field in the DeckLog) to link to the ShipsLog.  It doesn't seem to do anything.  What am I doing wrong?

    Like
      • Sean
      • Sean
      • 1 mth ago
      • Reported - view

      Mariner of the Sea of Cortez Hi Dan, You used double quotes for the field -Log Date- which makes it a string. Try it with single quotes and it should work.

      Like
      • Captain Quint
      • Master and Commander of the Sea of Cortez
      • danberkey
      • 1 mth ago
      • Reported - view

      Sean I suspected it had to be something trivial to the eye but significant to the syntax.  It works, thanks so much!

      Like
Like Follow
  • 1 mth agoLast active
  • 53Replies
  • 14643Views
  • 2 Following