×

Form interactions

Activites are the actions which are done between an interested party and your company. We refer to the interested parties here as customers.

The customer are:

  • the customer record: name and city
  • and the employee record, the field: contact note

The contact note can be an existing employe or a new person.

The activities are defined in the basic groups:

  • activities

Each activity can be assigned to an own employee. This is one of the logged in user, defined in the data definition:

  • searchuser

A new record is inserted with the logged in user name. User with special rights can change the user name and assign an separate user.

The status defines, if it's "planed" or "done".


The interactions

Customer and employee

customer field

If the customer is typed in, by each key the datalist is loaded and displayed under the customer. By a change of the customer, depending on the value it happens following:

  • empty: contactnote, phone and email is deleted, the default clause of contact note datalist (the accountID) is deleted too.
  • valied customer: contactnote is deleted, phone and email filled with customer data, the contact note datalist default clause is filled with the accountID. Only employee of this company can be choosen

customer dropdown

The customer dropdown is filled with the menu of the customer master data element with data link specification:

  • Remove
  • Edit
  • Business card

contact note

The contact note can be an employee of the master data employee list or a free free text:

  • new free text: nothing happens
  • employee from list: the customer and phone and email is inserted, the contact note datalist default value is set to the customer accountID

User name

All users are in the table k8login. The data definition k8searchuser is used to search for usernames.

A new record is inserted with the logged in user name. User with special rights can change the user name and assign an separate user.

In this example the userID is assigned to the creatorID, the owner of the recordset.

The user with the right to change the creatorID needs to be member of a special role. This is defined in the datadefinition:

  • masterdata
    • role_change_creator: 2

This role is checked twice: by JavaScript before creating the form and by the data access class before writing the record into the database.

Status and activities

The activities are entered in the group basics. In the datadefinition they are defined in the section 'optionsadditional'

The status can have the values 'planed' or 'done'. The corresponding entry list is defined in the tabulator and k8form sections.


Developer

Tables and SQL Statement

The 3 main tables are:

  • er_customeractivities, this table
  • er_customer, the customer
  • er_employee, the customer employees

The main fields, which should be available in each data definition are:

  • er_customer.accountID
  • er_customer.accountnumber
  • partnerdisp: accountnumber, name1, city)

The sql statement is extended to k8login for the username and to er_customer for accountnumber and partnerdisp:

Datadefinition

This are the special main entries for the activity data definition:

  • "head_end": activities_head_end.js
  • "settingsadditional":["customermaster","employee","k8searchuser"],
  • masterdata
    • role_change_creator
    • sql_derived

kitsamples/activities/activities.json

Datalists

In this form are 3 datalists defined by the corresponding form fields:

  • partnerdisp (inputgroup: customer_search, customer object)
  • contactnote (customer employee)
  • username (our employee)

The datalist are populated by a keypress and results are shown beneath.

Workflow datalists

  • datalists are created by the build of the form:
    • settings.k8form.datalists.<field name>
  • new recordset, contactnote
    • default clause is emptied
  • display record, contactnote
    • accountID set

datalists

Contact note

The contact note is a datalist field. Depending of the customer field:

  • customer empty: it searchs in all employees
  • customer set: it searchs only for employees of this customer

To achieve this behavior the following call back functions are used:

  • cbAfterLoad
  • cbAfterNew

This call backs call the function init_contactnote(). init_contactnote() sets or delete the default clause and loads the datalist for 'contact note'.

After the change of contact note:

  • the default clause for the customer is set
  • the fields of the 'data-fieldlist' are filled:
    • accountID
    • accountnumber
    • partnerdisp
    • phone
    • email

Part of activities_head_end.js (callback and change):

Customer dropdown

The customer dropdown is defined in the datadefintition customermaster. The customer field here in the activities is an inputgroup. The first element of this inputgroup is the customer dropdown. This dropdown is filled with the dropdown definition of customermaster.

The actions are coded in the click event of the dropdown.

Part of activities_head_end.js (customer dropdown):

Colored group "activity"

The activities are filled out in the basic groups.

The configuration is explained in colored groups.

to the right are special adjustments of this data definition.

Colored group "status"

The status and its values are defined manually for:

  • tabulator list
  • k8form