Client Scripting with Reference Objects
- Create a new Client Script
Name: Lab 2.5 Reference Objects Table: Change Request UI Type: Desktop Type: onChange Field: Configuration Item Active: Selected Inherited: Not selected Global: Selected
- Examine and write the script:
function onChange(control, oldValue, newValue, isLoading, isTemplate){ if(isLoading || newValue === ''){ return; } var affectedCI = g_form.getReference('cmdb_ci', checkCI); function checkCI(affectedCI){ if(affectedCI.name == '3D Pinball'){ g_form.setValue('priority', 4); g_form.setValue('risk', 5); g_form.setValue('impact', 3); g_form.setReadOnly('priority', true); g_form.setReadOnly('risk', true); g_form.setReadOnly('impact', true); } } }
- Select Submit