Custom Request Forms

Request>Maintain Items >> NEW . Fill out the details (business_service and Category should associate to Service Offering)

Common Variable set : RITM_Common_User_Information

  • Used to capture Ordering For information.

  • If you want to hide Multiple Users and Departments for Ordering For options :
    Create New Catalog Client Script under the Item

Applies to: A catalog item
Type = OnLoad
UI Type = All
Script :
function onLoad() {
g_form.removeOption('ordering_for', 'department');
g_form.removeOption('ordering_for', 'multiple_users');
}

Common Variable Set: RITM COA

  • Used to record COA information. Includes verification.

Common Variable Set: RITM_Common_Building_Set

  • Used to display building information.

  • Integrated with the building tables from FASIT

Variable and Variable Set Requirements:

  • Start variable and variable sets with an abbreviation of request form being worked on.

    • Example : pmo_req_start_date, pmo_req_end_date, pmo_req_project_name)

  • Request Form variables are recommended to not be contained in a variable set

Workflow: (Runs on sc_req_item)

Adjust Delivery time under properties.
Always Publish after making changes. ‘Check Out’ is to edit the workflow.

Catalog Tasks should follow the below conditions. (Remove ‘Always’)

Incomplete : activity.result == 4
Complete : activity.result == 3

Set State of RITM based on Incomplete or Complete by ‘Set Values’ activity

 

MISC Code Snippets:

Making a field Mandatory : g_form.setMandatory('NAME OF VARIABLE', true);

Making field Read-Only: g_form.setReadOnly('NAME OF VARIABLE', true);

Validating Date to be Future: (OnChange)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

var now = new Date();
var date = new Date(newValue);
g_form.hideFieldMsg('NAME OF DATE VARIABLE', true);
if (date.valueOf() < now.valueOf()) { g_form.setValue('NAME OF DATE VARIABLE', ''); g_form.showFieldMsg('NAME OF DATE VARIABLE', 'Please enter a date in the future.', 'error'); }

}

Make Sure one checkbox is selected

function onSubmit() {
//Type appropriate comment here, and begin script below
var checkboxes = ['dg_mission_enablement', 'dg_data_informed', 'lux_student', 'lux_researcher', 'lux_other'];
var isSelected = false;

for (var i = 0; i < checkboxes.length; i++) { if (g_form.getValue(checkboxes[i]) == 'true') { isSelected = true; break; } } if (isSelected == false) { g_form.addErrorMessage('You must select a role before you submit the request.'); return false; } }

Get Reference value

var requester = g_form.getReference('variable to get values from',setVariables);

function setVariables(requester){

g_form.setValue('variable to set value of',requester.reference field to reference);
}