Adding a new field to a window and database

In this section we are going to illustrate how the System Administrator would go about adding a new field to the database. As an illustration, we are going to add a probability reference field that can be used to measure a predefined set of outcomes on an order to the Sales Order window.

  1. Find the context by Zooming to the Table from the Window. Open and find the Sales Order window in the Window, Tab, and Field menu item when logged in as System Administrator:
    Adding a new field to a window and database
  2. Zoom from the window into the underlying Table and Column window. Order records are maintained in the database in the C_Order table:
    Adding a new field to a window and database
  3. Next we refer the Column tab, and create a new column in the table (see the field naming conventions below). The new column must be as a System Element defined and hence we need to create a System Element prior to using it as a Column in the Table:
    Adding a new field to a window and database
  4. Once the System Element has been defined, we set up the Column as follows:
    Adding a new field to a window and database
  5. Create a new Reference key as follows:
    Adding a new field to a window and database

    Because this is a custom list, we choose a validation type of List Validation, and a value format of L, indicating that any letters are allowed. For a full list of these conventions, refer to the help documentation in the system by pressing F1.

  6. We then define the Reference key's list validation options as follows:
    Adding a new field to a window and database
  7. The finalized column (and thus the ultimate window field) set-up is thus shown as follows:
    Adding a new field to a window and database

We finalize the set-up of the field by indicating:

  1. Field naming conventions: Compiere recommends that customer-specific table and database column names be prefixed by EXT_, XX_, or CUST_, or the four letter entity registered with Compiere, such as SAAC_. This would also apply to indexes and constraints. The reason for this is that these entities are ignored in the migration process.
  2. Length of field: Because we know that for this particular field there is going to be only one character we define a length of 1.
  3. Default logic: We assume U, based on our list being Unknown.
  4. Mandatory UI: Indicates that this field will be mandatory in the window, but not at database level.
  5. Updatable: Indicates that the field is editable.
  6. Always Updatable: Indicates that the field is always updatable, regardless of document status.

Final step in column creation—Create / Synchronize with the database

The final step in the process of creating a field is to make sure that it is synchronized to the underlying database from the AD. Scroll down on the column tab to find the Synchronize Column button, as shown in the example below:

Final step in column creation—Create / Synchronize with the database

Adding our custom field to the Order window

Back in the menu item Window, Tab, and Field (find the Sales Order window) > Tab (header/top level):

  1. Click on the Create Fields button to add the field to the database:
    Adding our custom field to the Order window
  2. Change the desired sequence of the field to the correct position in the list of fields:
    Adding our custom field to the Order window
  3. Re-open the appropriate Sales Order window to display the field:
    Adding our custom field to the Order window
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset