Creating Client Objects
First of all, let’s define why we need to create a client object. Most often, this is due to the need to make specific settings for different client interfaces. Hence the name — client objects. When you want to display the same table in the main menu and, for example, inside a form with a data slice limited by that parent form (e.g., an Order Items table inside an Order form), or two different forms, a full one and a simplified one, with different sets of fields — you need client objects.
Creating a Profile and Synchronization
To create a client object, you need to go to the System -> Client objects menu, create a new record in the table, specify a name, and select the class for which you are creating the CO (Client Object). After creating the record, use the context menu to select Synchronize with Class.
Naming Recommendations
The primary goal of the rules is to make the purpose of the object roughly clear from its name.
The name must be unique.
For tables:
It should start with table_ for tables placed in the main menu (i.e., in the main interface) or tbl_ for tables embedded in forms/frames/modal windows.
In some cases, for example, when a table is customized and used as a set of filters rather than a direct table, the client object might be named something else, like dashboard_....
The prefix is usually followed by the class name, and then an optional clarification. For example, table_order_full or table_user_admins_only.
For Frames and Forms:
Similar to tables, but with different prefixes. Since forms cannot be embedded into anything else, there is no short form for them, only the full form_. For frames, it can be frame_ or frm_. Again, these are just recommendations; if you believe another name is more suitable, it’s acceptable to deviate from them.
Synchronization with Class
During synchronization, missing fields will be added. Additionally, the dialog box will offer extra options, namely: synchronize all or specific settings (client object field profile) and delete non-existent fields (fields removed from the class).
Checkbox “Synchronize fields (field profile, e.g., filter_type_id)”: Allows all client object fields (id, name, sysname, description… those belonging to this client object) to inherit selected settings (fields) from the class. To do this, check the box and leave “*” in the input field.
You can transfer only some settings; to do this, also check the box, but in the input field, list the names of the field profiles (in English, as they are specified in tablesCore.json in class_fields_profile) that you want to transfer, separated by commas. For example, editable, filter_type_id.
Checkbox “Delete fields”: Allows deleting fields if they were deleted in the class. Previously, there were mechanisms that allowed a client object to have fields not present in the class, so this checkbox is not checked by default in some projects. Now, the checkbox is checked by default.
“Delete physically” is also checked by default. Leave it checked. it disables soft deletion for these records.
Synchronization with Class (Update Class)
Allows the reverse: merging settings made at the client object level back into the class. This is useful when you have configured one client object (brought it to a user-friendly form — hid unnecessary fields, gave clear names, added tooltips, configured filters…) and now want all these settings to be applied to the class, so that other client objects can receive these settings during creation or synchronization.
You can also specify a transfer of all settings (“*”) or list the required ones separated by commas in the input field.
Synchronize to Another Client Object
Similar to the previous point (“Synchronization with Class (Update Class)”), this allows transferring all or part of the settings, but not to the class, but to another CO. For this, there is a field in the dialog box where you need to enter the ID of the CO you want to merge settings into.
Set Profile Value Massively
Sometimes, a developing system has many similar client objects based on one class (for example, for different roles), and updating them all one by one if we need to make changes to all of them is quite tedious. In such cases, you can do it massively. To do this, select the necessary rows in the table (the client objects you want to update), select this item in the context menu, and then, in the dialog box, specify 3 fields:
- Which field we are changing (this is
column_name, as it is written intables.json). - Which setting we want to set (this could be the
visiblecheckbox or the editor type (type_of_editor_id) or any other setting). - What value to set this setting to.
Synchronization will work for all selected client objects.
There are also Load, Save, and Clear buttons, which allow you to save and restore entered data so you don’t have to enter everything from scratch every time.