Forms module

Forms basics

Forms are introduced in Project.net as customer need to create user specific Web forms with specific input fields. In forms currently exist in Project.net there are almost all standard Web input elements, only file upload and radio buttons are not supported. Forms module have and some Project.net specific input field types which will be described in separate Forms section. Here will be described what tables will be used for Forms module and order of actions and data manipulations depending of users actions in front-end.
There are several main actions user can perform in front-end:

  • Create form
  • Create List
  • Add some element (field) on the form
  • Select workflow
  • See preview for the form
  • Activate form

Creating a new form

Creating a new form is the first step you have to do. There are several actions which are performed in back-end when user creates a new form.

First thing that happens in back-end when we click on button for new Forms creation is space access history update. There is table named PN_SPACE_ACCESS_HISTORY which updates time for appropriate space and person. This table is updated with current timestamp time. After that application inserts new object type in table PN_OBJECT. For forms there is specific object type named "form". This object type name can be seen in table PN_OBJECT_TYPE.
After creating new object application applies new security permissions for that object via CREATE_SECURITY_PERMISSIONS stored procedure in package SECURITY.

Now application stores actual data for the defined form (Form name, Form abbreviation etc). Those data is stores in table PN_CLASS. The other values which can not be seen in the form created and exists in table PN_CLASS are:

  • CLASS_TYPE_ID - identifier for the class type. Possible class types can be seen in table PN_CLASS_TYPES. This identifier in this case corresponds to object created, form in this case, and value for form is 100.
  • OWNER_SPACE_ID - this is identifier for space which this form belongs. In case that user created form outside some specific project than this value corresponds to object identifier for that user and if user creates form in some project, than this value corresponds to object identifier for that project.

During the form creation application takes care about Forms history, so each form creation is noted in table PN_FORMS_HISTORY. In this table there some other additional informations stored such as exact time when form is created, Form identifier, of course, name of the form etc. This action is performed via stored procedure LOG_EVENT placed in FORMS package.

If is option "Display in Tools Menu" selected during the form creation then application stores this information in PN_SPACE_HAS_FEATURED_MENU_ITEM table. There are only two columns in this table, for space and object identifier. So here is placed space for project if this form was created in project space or space for user if user created form outside the project and object identifier for the form created.

Creating a new field on form

Like with creating new forms and here first thing that happens when application adds new filed on form is new object creation. In table PN_OBJECT application inserts new record with object identifiew and now with different object type "form_field". Right after new object creation application applies security permissions by executing stored procedure CREATE_SECURITY_PERMISSIONS in SECURITY package.

Now comes the main part with adding new fields on the form. Application insert record in PN_CLASS_FIELD table. There are several important informations stored in this table. First one is object identifier for new field (placed in column FIELD_ID), next is space identifier corresponding to project/person identifier (placed in SPACE_ID column) and the form identifier (placed in CLASS_ID column) which shows on what form that field will reside. In this table you can find all others informations entered in front-end during the form field creation. Important column in this table is ELEMENT_ID which is the foreign key from table PN_ELEMENT which shows which element is selected to be added on the field. All other fields in this table are self explainable. There are several possible form fields:

  • text - One-line text field
  • textarea - Scrolled text box
  • selection_menu - selection menu
  • date - Date/Time Field
  • checkbox (yes, no) - check box field (true or false)
  • person_selection - menu for seleciton of people
  • milestone - menu for selection of milestone
  • horizontal separator - horizontal form separator with title text
  • instruction - static instruction text
  • number - A number
  • currency - A currency value
  • calculation_field - A Calculated Field

The last actions during the new field creation are adding new properties for that field. For each new field created, there are always four new records in PN_CLASS_FIELD_PROPERTY table. There are four properties for size, maxlength, size and fieldDomainValueID.