Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Relationships form fields

FieldDescription
NameRelationship name displayed in the list.
Apply to
This field references to tables dictionary (the Table (sys_db_table) table).
Specify the table on the forms of which this related list will be displayed.
Query from
This field references to tables dictionary (the Table (sys_db_table) table).
Specify the table containing the source records for this list.
Query withIn this
field 

Это таблица sys_related_list_script. 

Ключевое

Name - имя синтетического связанного списка

Apply to - к какой форме мы это применяем. На форме какой таблицы. Ссылка (reference) на sys_db_table. Нужно указать таблицу. По смыслу это ссылка на таблицу. Отображается Title таблицы. На формах записей, которые относятся к этой таблице, мы будем выводить наш ССС.

Query from - референс на таблицу, из которой мы будем вынимать записи для этого списка. 

Далее самое интересное.

Query with - скрипт, который нам формирует условие выборки. Есть несколько ключевых моментов:

  1. Есть объект current, это самое важное, это объект таблицы, для которой мы создаем наш query (таблицы из поля query from). По смыслу мы создаем какой-то запрос, который будет делать выборку для этого листа. И ключевое, что в этом скрипте должно быть, это, current.addQuery, и дальше какой-то там query, или какие-то addCondition, и тд тд и тд, и в итоге для current мы должны сформировать какой-то запрос, и соответственно исходя из этого он будет показывать записи.
  2. Есть объект parent, это ссылка на объект формы из apply to. Parent это форма записи, current это лист таблицы из query from. Вот, собственно говоря, и все. Исходя из этого query, мы формируем запрос и выводим обычный стандартный релейтед лист как положено.

...

field, you can put down a script specifying the records to include from the table processed by this relationship.


In your scripts, you are free to use current and parent objects. 

Image Added


Info
  1. The current object is an object of the table where the query is created (the table specified in the Query from field)
  2. The parent object is a reference to the object of a table specified in the Apply to field.

In other words, the parent object is a record form specified in the Apply to field, and a current object is a list from a table specified in the Query from field.

You can use any SimpleRecord server class methods as directives in the current and parent objects,