1. Erik Segerdell
  2. Valentina Studio
  3. Thursday, March 28 2019, 11:07 PM
  4.  Subscribe via email
Is there a way to automatically refresh views of related records in a form, after a new related record has been added? For example in Screen Shot 1, the "Strains" table at the upper right is a View of records related to the current Individual Experiment ("testexp1";). We can add a new record using the import mechanism, and the new row can seen in the same table in Screen Shot 2. However, this view does not refresh right after adding the record. The new row does not appear unless you click the ">" button to go to the next Individual Experiment, then click "<" to go back to testexp1 (or unless you close and re-open the form). We've tried to add a button with the action "View --> Reload records" but this does not work.

Thanks!
Attachments (2)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Hello Erik,

Please specify - how do you add a new record? Using the form for a related table with "Add" data mode?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 1
Erik Segerdell Accepted Answer
That's correct.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 2
Erik Segerdell Accepted Answer
I should add that this is also the case when the view isn't mapped -- e.g., here is a new screen shot that is similar to the previous ones, except that the view underneath "All Compounds" contains all records rather than related ones. When a new Compound is added, the view does not refresh unless the form is closed and re-opened.
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 3
Sergey Pashkov Accepted Answer
Is "All Compounds" TableView based on a table, and not on a view or query?
Also, what database is used?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 4
Erik Segerdell Accepted Answer
The "All Compounds" TableView is based explicitly on a view, not on a table. Here is the query used to create the view:


SELECT all_compounds_table.comp_id AS "Compound ID",
all_compounds_table.comp_name AS "Compound",
all_compounds_table.comp_abbr AS "Abbreviation",
compound_controls_table.control_name AS "Control"
FROM (all_compounds_table
LEFT JOIN compound_controls_table ON ((all_compounds_table.control_id = compound_controls_table.control_id)))
ORDER BY all_compounds_table.comp_id;


We are using a PostgreSQL database.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 5
Sergey Pashkov Accepted Answer
Thank you,
to update the TableView based on a View you can use the following method:
this.TableViewName.reload()
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.