Jam.py documentation

Lookup fieldsΒΆ

Now we will create the “Contacts” item.

Select the “Journals” group in the project task tree and add a new journal in the same way that we created the “Customers” catalog.

First we add the “Date” field of the “datetime” type and then “Notes” fields of the “text” type.

Let’s add the lookup field “Customer” that will store a reference to a record in the “Customers” catalog.

Adding Customer field

To create a lookup field, after specifying its caption and name, we need to select a lookup item. Click the button to the right of the Lookup item input and double click the record to select it.

Selecting Customer lookup item

The same way specify a lookup field.

Now we add “Firstname” and “Phone” lookup fields. But for this fields we specify the “Customer” field as their master_field attribute. In this case the server won’t create for them fields in the database table.

Now add the lookup fields “Firstname” and “Phone”. But for these fields we specify the “Customer” field as their master_field attribute. In this case, the server will not create fields for them in the database table.

Firstname lookup item

Click the “OK” button to save the “Contacts” item.

Contacts sql

Now we create a lookup List “Status”.

Select the “Task” node in the project tree and click the Lookup lists button.

Lookup lists

Click the New button and specify the new lookup list name and add a list of integer-text pairs:

Lookup list entries

Save the Lookup Lists dialog and open the “Contacts” journal to add the “Status” field using the “Status” lookup list as a Lookup values attribute:

Status lookup field

Before saving open the “Customer” field and set the Required and Typeahead attributes. When the Typeahead checkbox is checked, typeahead is enabled for the lookup field.

Customer attributes