Client Scripting with Reference Objects

  1. Create a new Client Script
  2. Name: Lab 2.5 Reference Objects
    Table: Change Request
    UI Type: Desktop
    Type: onChange
    Field: Configuration Item
    Active: Selected
    Inherited: Not selected
    Global: Selected
    
  3. Examine and write the script:
  4. 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);
            }
        }
    }
    
  5. Select Submit

results matching ""

    No results matching ""