Notifications

8 views

Description

The emergency self report application allows managers to report health status on behalf of the employees. If a manager has chosen one person to report a health status, after clicking submit and changing the person, the health status dropdown does not clear to 'None'. How to make this possible?

Release or Environment

NewYork

Resolution


This can be achieved by adding an 'OnChange Client Script' on 'Crisis Task' table (sn_imt_quarantine_crisis_task)

The widget displays the two fields, 'Person' and 'Health Status', from the above mentioned table and adding an 'OnChange client script' to clear the value on 'Health Status' every time 'Person' field is changed, this use case can be achieved.

Steps:
1. Go to Client script and create a new one.
2. Populate the values:
Table - Crisis Task (sn_imt_quarantine_crisis_task)
UI Type - Mobile/Service Portal
Type - OnChange
Field Name - Person
Global - True
Script -
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

//Type appropriate comment here, and begin script below
var reqType = g_form.getValue('request_type');

if (reqType != ''){
g_form.clearValue('request_type');
}
}

3. Save the Client script


Article Information

Last Updated:2020-06-07 09:32:47
Published:2020-04-17