Script to load a table from a form

Viewing 1 reply thread
  • Author
    Posts
  • April 6, 2019 at 10:50 PM #34309

    Rob Young
    Participant

    I want to populate a task list form (form A) from a reusable set of activities for things like preparing to travel and setting up camp with my travel trailer and tow vehicle. I created a form (form B) with task fields and created several records representing activities. I created the task list form with a date field and a table (columns names matching the field names in form B). I’ve successfully manually loaded the table in form A with the fields and filtered records from form B. I would like the table in form A to be automatically loaded with a filtered and sorted set of rows from form B when a new record is added to form A. Is this a job for a script? Is there a script example I can use to accomplish this?

    Thanks in advance for any help!

    April 7, 2019 at 1:31 AM #34310

    Brendan
    Keymaster

    Hi Rob,

    Basically you would need to use the record.addRecordToField(someRecord, field_id); which takes a record (someRecord) that you’ve already created and adds it to the Table field with field_id. Or use the var newRecord = record.addNewRecordToField(field_id); function to create and return a new record which you could then populate since it passes back a reference to the new record just added. The field_id would be the ID of your Table field.

    Thanks!

    Brendan

Viewing 1 reply thread

You must be logged in to reply to this topic.