There are several ways you can use formulas to configure the people management templates:
A Template Validation formula can check values entered in a field.
A Template Information formula can specify information to be displayed from the right mouse menu when a user right-clicks in a field.
A People Management Message formula can return a text string to display in the Assignment field on the Maintenance window and in the Data Organizer.
A People Management Message formula can return message tokens that you can use in a notification message issued from template forms.
If you use a formula to validate user entries in template fields, you must observe the following rules:
Select the formula type Template Validation in the Formulas window.
There can be up to five inputs, and they must be called item1, item2, item3, item4, and item5.
The formula can return up to three outputs, which must be named as follows:
Status, which must have the value 's' if the validation was successful. Any other value is interpreted as an error.
Message, which is a text variable. The formula can return a message with validation statuses of success, failure, or both.
Item, which is the new value of the field that is being validated.
After creating the formula, you select it in the Validation Formula property for the field when you are setting up the template in the People Management Configurator. You can also enter up to five parameters to be passed to the formula, including the value you are validating. For example, you might enter the name of another field on the template if you want the formula to cross-validate the value in one field against another.
Here is a formula that validates the entry in the Organization field on the Maintenance window. It raises an error if the entry is not Corporate Finance.
/* Updateable Values Section */
/* Defaults Section */
/* Inputs Section */
INPUTS ARE item1 (text) /* Main Body of Formula */
organization_name = item1
status = 's'
message = ' '
IF organization_name <> 'Corporate Finance' THEN
(
message = 'Organization must be Corporate Finance'
status = 'f'
)
RETURN message, status
When you are setting up the template in the People Management Configurator, select the Organization (Maintain) item. Select the name of your formula as the Validation Formula property and select Organization (Maintain) as the Validation Formula Parameter 1 property. This passes and validates the value the user enters, not any codes or table identifiers to which it may be related.
If you write a formula to return additional information for a field, you must observe the following rules:
Select the formula type Template Information in the Formulas window.
There can be up to five inputs, and they must be called item1, item2, item3, item4, and item5.
The formula can return one text output, which must be called Message. This is the information that is displayed when the user right clicks in the field and selects a prompt that you define in the right mouse menu.
After creating the formula, you select it in the Information Formula property for the field when you are setting up the template in the People Management Configurator. You can also enter up to five parameters to be passed to the formula. For example, if you were specifying an information formula for the job field, you might enter the name of the organization field so that the formula can return different additional job information depending on the organization.
Here is a formula that returns contact information to be displayed from the Supervisor field.
/* Updateable Values Section */
/* Defaults Section */
DEFAULT FOR sup_work_phone IS ' '
DEFAULT FOR sup_email_address IS ' '
/* Inputs Section */
/* Main Body of Formula */
message = 'Supervisor Contact Details||CHR(10)||'Telephone:
'||sup_work_phone||CHR(10)||'Email: '||sup_email_address
RETURN message
Applicant and employee assignments are listed by name in the Data Organizer in the template Summary window and in the Assignment field on the Maintenance window. Since assignments do not have names, you can choose what assignment information is displayed as a name to help your users select the assignments they want to work with.
By default, assignments are identified as <job>.<organization>, such as Senior Manager.Engineering. However, you can choose any other database items to display.
If you want to override the default, write a formula (of type People Management Message) called ASSIGNMENT_NAME. This formula must return a text string. If there is no formula called ASSIGNMENT_NAME on the database, the system uses the predefined formula QH_ASSIGNMENT_NAME.
The QH_ASSIGNMENT_NAME formula is as follows:
/* Updateable Values Section */
/* Defaults Section */
DEFAULT FOR asg_job IS ' '
DEFAULT FOR asg_org IS ' '
/* Inputs Section */
/* Main Body of Formula */
assignment_name = asg_job||'.'||asg_org
RETURN assignment_name
If you write a formula to return messge tokens, you must observe the following rules:
Select the formula type People Management Message in the Formulas window.
The formula must have the same name as the notification message that will use the tokens.
The formula can return up to five text outputs, which must be named FF1, FF2, FF3, FF4 and FF5.
Suppose you want to include an employee's preferred name in a New Hire notification. The New Hire notification is called NEW_STARTER, so you create a formula of the same name that returns this name in the variable FF1:
/* Updateable Values Section */
/* Defaults Section */
DEFAULT FOR per_known_as IS ' '
/* Inputs Section */
/* Main Body of Formula */
FF1 = per_known_as
RETURN FF1
Then you edit the New Hire notification to include the FF1 variable. For example:
Please note, that we have a new employee as of &HIRE_DATE.
They are &FULL_NAME (&EMPLOYEE_NUMBER).
Known as: &FF1.
Their new job details are:
Position: &POSITION
Job: &JOB
Organization: &ORGANIZATION
Location: &LOCATION