How to add new dictionaries

Speaking about the dictionary we mean supporting entity. Typically, these entities can be edited via the inline grid. In this example, we will look at:

  • Creation of model and view for simple dictionary
  • Creation of form with inline grid for editing dictionary entries
  • Adding permissions for form
  • Adding form to left menu
  • Adding of field to the newly created dictionary with a choice from the list

1. Creation of model and view for simple dictionary

1.1 Execute CreateProjectDictionary.sql script. A table with name “Project” will be created in your database. 1.2 Open Admin of DWKIT 1.3 Open Settings section and check that Connection string for Update data model (last setting in the list) matches connection string to your database. 1.4 Open Data Model section. Click Update model link button above of the Data Model grid. In the Updating model tree select “Project” table and click Apply button. Data Model item named “Project” must be created. 1.5 Open created “Project” Data Model object. 1.6 For enable Optimistic locks on this object click on “LockVersion” attribute in the grid with attributes. Change Purpose field from "Normal" to "Field for Versioning". Click Save and Exit button. In Data Model’s edit form select Support optimistic lock check box. Click Save button. Now Optimistic lock for this model is switched on. 1.7 For enable Logical delete on this object click on “IsDeleted” attribute in the grid with attributes. Change Purpose field from "Normal" to "Logical Deleted". Click Save and Exit button. Now Logical delete for this model is switched on. 1.8 Open View section. Click on Create link button above of the View grid. 1.9 Fill Name field with “Project” and select “Project” Data Model as Model field. Click Save button. 1.10 Now you need to select the columns to be displayed and edited.

Code: set Order = 1, Width = 100, Show = checked, Edit = checked
Name: set Order = 2, Width = 150, Show = checked, Edit = checked
Comment: set Order = 3, Width = 150, Show = checked, Edit = checked
Type: set Order = 4, Width = 100, Show = checked, Edit = checked

Click the Save button.

Screenshots:

Screenshot 1 Screenshot 2

2. Creation of form with inline grid for editing dictionary entries

2.1 Open Form section. Click on Create link button above of the Form grid. 2.2 Fill Name field with “Project” and Caption field with “Projects dictionary”. Click Save button. 2.3 To add a new Block in this Form click on Create link button above of the Blocks grid. 2.4 Fill Name field with “Main”, choose "Dictionary inline" as Template. Click on Load params button near Template params label. You will see:

@Prefix=form
@ViewName=
in Template params field. Fill this field as:

@Prefix=form
@ViewName=Project
Click the Save button.

Screenshots:

Screenshot 3

3. Adding permissions for form

3.1 Open Form section. Select “Project” form in the Forms grid using checkbox in left column. Click on Create permissions link button above of the Form grid. 3.2 Open Security section. Click on Roles point in dropdown menu. Click on “Admins” role record in Roles grid. 3.3 Click on Expand all link button above of the Permissions grid (bottom of Role edit form). Select all checkboxes in “Project” group. Click on Access link button above of the Permissions grid.

4. Adding the form to the left menu

4.1 Open Menu section. Click on Create link button above of the Menu grid. 4.2 Fill Name field with “Project”, select "Left" as Type field and select “Project” Form as Form field. Click Save and exit button.

Screenshots:

Screenshot 4

Now you must see menu point “Project” in your “SimpleProject” click on this point. You must see grid with inline editor. But the “Type” field is just a number and we want to see a list with selection in this field. Using the List functionality we can add a siple list in this field.

5. Adding of field to the newly created dictionary with a choice from the list

5.1 Open Data Model section. Click Lists link button above of the Data Model grid. 5.2 Click Create link button above of the Lists grid. 5.3 Fill Name field with “Project types” and List field with:

0=Active
1=Archived
2=Postponed

Click the Save button.

5.4 Open Data Model section. Click “Project” Data Model. Click “Type” column in Columns grid. Fill List field with “Project types” List. Click Save and exit button.

Now open “Project” menu point in your “SimpleProject. You must see dropdown list with three options in “Type” field when you editing or creating a record.