Create a Client Script
- Create a new Client Script:
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
- Examine and write the script:
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); } } }
- Select Submit