============
Lookup lists
============

Now we create a 
:doc:`lookup List </admin/lookup_lists>`
"Status". Lookup lists are used to create "dropdown" field, with a limited
set of possible values.

Select the "Task" node in the project tree and click the **Lookup lists** button.

.. image:: /intro/_images/lookup_lists.png
	:align: center
	:alt: Lookup lists

It is initially empty. Click the **New** button to create a new list.
Specify the new lookup list name and add a list of integer-text pairs:

.. image:: /intro/_images/lookup_list_ready.png
	:align: center
	:alt: Lookup list entries
	
Save the Lookup	Lists with the **OK** button, then edit the "Contacts" journal
to add the new "Status" field

.. image:: /intro/_images/status_field.png
	:align: center
	:alt: Status field

As for lookup fields, set the caption and name and leave the type empty. Then go to
the **Lookup** tab, and set the **Lookup value list** attribute to the "Status" lookup list:

.. image:: /intro/_images/status_lookup.png
	:align: center
	:alt: Status lookup field
	
Finally, before saving, open the "Customer" field we created earlier,
and set the **Required** attribute (in the "Field" tab) and the **Typeahead** attribute
(in the "Lookup" tab). When the **Typeahead** is checked, autocompletion/typeahead is
enabled for the lookup field.

.. image:: /intro/_images/customer_required_attr.png
	:align: center
	:alt: Customer attributes

.. image:: /intro/_images/customer_typeahead_attr.png
	:align: center
	:alt: Customer typeahead attribute

While we are here, set **Default value** of the "Contact date" field to "CURRENT DATETIME",
so that the date will be automatially initialised to the current date and time.

.. image:: /intro/_images/contact_date_default_value.png
	:align: center
	:alt: Contact date field default value

We can likewise select a **Default value** for the "Status" field, by selecting a value
in the drop-down lists.

.. image:: /intro/_images/status_default_value.png
	:align: center
	:alt: Status field default value
