Force the Updated Script to Execute

  1. Create a new Incident
  2. Select the Clear log icon to remove any existing log messages
  3. Select your preferred view (Small, Medium or Large) so the log messages are visible at the bottom of your screen
  4. Update the value of Impact to 1-High
  5. Review the log messages in the JavaScript Log: What is the value currently in the incState variable? What should it be? Does the string "LINE 11 EXECUTED!" appear as a logged message?
  6. At this point, you know something is wrong with the value in incState variable. Before leaving the Incident form, double-check the State field's name by right-clicking the field's label
  7. Open the Lab 2.3 Client Script Debugging Client Script
  8. Locate the statement at the beginning of your script that reads:
  9. var incState = g_form.getValue('incident');
    
  10. Review the State field's name in this statement, does it match the field name you documented in step-6?
  11. Update the statement to:
  12. var incState = g_form.getValue('state');
    
  13. Select Update
  14. Force your updated script to execute by creating a new Incident. If you closed JavaScript Log, re-open it
  15. Clear the JavaScript log
  16. Update the value of Impact to 1-High
  17. Confirm the Lab 2.3 Client Script Debugging Client Script executed as expected
  18. A decoration appeared to the left of the State field ( ? ) 
    ​
    The State's label flashed teal for four seconds ( ? )
    ​
    The State choice list options now only include 'New' and 'In Progress' ( ? )
    ​
    An Information Message appears at the top of the form confirming the State options removal ( ? )
    
  19. Review the messages in the JavaScript Log: Is the value of incState 1? Does the string "LINE 11 EXECUTED!" appears as logged message?
  20. If you answered No to any of these questions in two previous steps, debug and re-test
  21. Close the JavaScript Log and Field Watcher by select the Close icon
  22. Review the InfoMessage at the top of the form. Are you the only person who can see this script output?
  23. Form messages are a good debugging strategy as the results are instantly presented the top of the form you are testing on. Would this type debugging strategy be best in a development or production instance?

results matching ""

    No results matching ""