logo

NJP

Detecting Form changes in CSM/Agent Workspace

Import · Aug 31, 2022 · article

This is a quick workaround for CSM Workspace and Agent Workspace to detect when the form is dirty (i.e., field values have been changed).

According to the support document (KB0855260image

"g_form.modified, g_form.modifiedFields, g_form.getControl('field_name').changed, g_form.getElement('field').changed APIs will not work in agent workspace."

To work around this challenge in the Workspace environment, here are a couple of options using g_form just to see if the form itself has been updated:

  • g_form.isUserModified();
  • g_form.$private.isDirty();
    image
    image

These won't tell you the individually modified fields, but they will tell you if the form has been changed and has unsaved updates.

-Brian

View original source

https://www.servicenow.com/community/csm-articles/detecting-form-changes-in-csm-agent-workspace/ta-p/2297683