125 views

Description

Symptoms


Navigate to Software Asset>Software entitlement, create new. On submit you will receive error:

#####################################

onSubmit script error: TypeError: Cannot read property 'table' of null:

function onSubmit() {
var purchased_rights = g_form.getValue('purchased_rights');
var active_rights = g_form.getValue('rights');
var list = GlideList2.getByName('alm_license.samp_upgraded_entitlement.licensed_by');
var row = list.table.getElementsBySelector('tr.list_row');
var list_row_sysId;
var total_rights = 0;
if (purchased_rights < 0) {
g_form.showErrorBox('purchased_rights',getMessage('Please enter positive number'),true);
g_form.modified = false;
return false;
}
for (var num_rows = 0; num_rows < row.length - 1; num_rows++) {
list_row_sysId = row[num_rows].getAttribute('sys_id');
total_rights = total_rights + parseInt(list.getCell(list_row_sysId, 'num_rights').textContent);
if (total_rights > purchased_rights) {
g_form.showErrorBox('purchased_rights',getMessage('Do not have enough rights'),true);
g_form.modified = false;
return false;
}
if (active_rights != 0 && active_rights < total_rights) {
g_form.showErrorBox('rights','Do not have enough active rights',true);
g_form.modified = false;
return false;
}
}
return true;
}

#######################################

 

Cause


The software entitlement form is missing a form section "Upgraded entitlements". This form section is being accessed by the above code.

The upgraded entitlement section is part of file sys_ui_form_sections_08fdf65d1b3210002502fbcd2c071311

Resolution


  1. Navigate to sys_update_version table, please search for the file sys_ui_form_sections_08fdf65d1b3210002502fbcd2c071311
  2. Identify the file that is created on the same day as the SAMP activation
  3. Open the record, revert to this version of the file by clicking the related link "revert to this version"

 

Article Information

Last Updated:2020-05-27 13:39:42
Published:2018-09-14