How to: Create a comment field that writes to the Audit/History

Through the use of Custom JavaScript any field may be used to write an entry in the Comment History. Normally, one must enter a comment directly into the Comment field to add to it, but in a case where it is desirable this enables the History to take that input from another field

  1. Go to the Field List to configure the field to be used to write to the History.
    Module → Module Name → Forms (tab) → Create/Update Fields… (button)

  2. Select the Field intended to write to the History in the Custom JavaScript tab add the below on Init.
    (Note: FieldNameHere should vary)

    formScope.formdata.FieldNameHere = undefined;
  3. Within the Blur add the below script.

    if(formScope.formdata.FieldNameHere){ formScope.formdata.actionComment = formScope.formdata.FieldNameHere; } else{ formScope.formdata.actionComment = undefined; }
  4. Save the Field List.

  5. Add the field to the Default Form and Save the form.
    Module → Module Name → Forms (tab) → Default (name link)

  6. Open a request, fill in a value in the field, perform the Action validating that the value was written to the History as expected.

If you have reviewed the above and are experiencing any issue or have any questions contact Stratawise Support