Create a Client Script

  1. Create a new Client Script:
  2. Name: Lab 5.3 ResolvedBy Client Script
    Table: Incident [incident]
    UI Type: Desktop
    Type: onChange
    Field name: State
    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
        }
        if(oldValue > 5 && newValue <= 5){
            var answer = confirm("This incident was Resolved by " + g_scratchpad.resolvedByFirstName + " " + g_scratchpad.resolvedByLastName + " and has been reopened " + g.scratchpad.reopenCount + " times.\n\nAre you sure you want to reopen it?");
            if(answer == false){
                g_form.setValue('state', oldValue);
            }
        }
    }
    
  5. Select Submit

results matching ""

    No results matching ""