Get the sys_id from a script

Users can locate the sys_id of a record using a script.

  • The sys_id value of a record can be found in a business rule (or any other server-side JavaScript) by dot-walking from the GlideRecord.
    var id = current.sys_id;
  • The sys_id of a record can be found in client-side JavaScript using g_form.getUniqueValue() as shown in the following example.
    function onLoad() {
        var incSysid = g_form.getUniqueValue();
        alert(incSysid);
    }