<?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_script_client">
    <sys_script_client action="INSERT_OR_UPDATE">
        <active>true</active>
        <applies_extended>false</applies_extended>
        <condition/>
        <description>Ensure valid values are set for the Assigned CR User/Group fields, when required.</description>
        <field>action_time_to_live</field>
        <global>true</global>
        <isolate_script>true</isolate_script>
        <messages/>
        <name>TurbonomicActionSettingsValidation</name>
        <order/>
        <script><![CDATA[/**
 * Perform UI validation when modifying the Turbonomic Action Settings.
 */
function onSubmit() {
    var validUser = true;
    var validGroup = true;
    var populateAssignee = g_form.getValue('populate_assignee');

    if (populateAssignee == 'true') {
        var userName = g_form.getValue('assigned_user');
        var groupName = g_form.getValue('assigned_group');

        if (userName == null || userName.length == 0) {
            g_form.hideErrorBox('assigned_user');
            g_form.showErrorBox('assigned_user', 'Please select a valid user');
            validUser = false;
        }
        else {
            g_form.hideErrorBox('assigned_user');
            validUser = true;
        }

        if (groupName == null || groupName.length == 0) {
            g_form.hideErrorBox('assigned_group');
            g_form.showErrorBox('assigned_group', 'Please select a valid group');
            validGroup = false;
        }
        else {
            g_form.hideErrorBox('assigned_group');
            validGroup = true;
        }
    }

    return (validUser && validGroup);
}]]></script>
        <sys_class_name>sys_script_client</sys_class_name>
        <sys_created_by>alexpetrean</sys_created_by>
        <sys_created_on>2019-04-26 20:20:43</sys_created_on>
        <sys_domain>global</sys_domain>
        <sys_domain_path>/</sys_domain_path>
        <sys_id>39b91839db8d33400b25ebd84896199f</sys_id>
        <sys_mod_count>18</sys_mod_count>
        <sys_name>TurbonomicActionSettingsValidation</sys_name>
        <sys_overrides/>
        <sys_package display_value="Turbonomic Actions" source="x_turbo_turbonomic">be4eeab2db007f005e691fe968961902</sys_package>
        <sys_policy/>
        <sys_scope display_value="Turbonomic Actions">be4eeab2db007f005e691fe968961902</sys_scope>
        <sys_update_name>sys_script_client_39b91839db8d33400b25ebd84896199f</sys_update_name>
        <sys_updated_by>alexpetrean</sys_updated_by>
        <sys_updated_on>2019-04-29 22:01:36</sys_updated_on>
        <table>x_turbo_turbonomic_turbonomic_settings</table>
        <type>onSubmit</type>
        <ui_type>10</ui_type>
        <view/>
    </sys_script_client>
</record_update>
