Notifications

157 views

Symptoms


Tasks are created with empty numbers on table sn_customerservice_task

Release


Kingston Patch 9

Resolution


Able to fill the number field for all the records that have the empty number value, using the below script:


var current = new GlideRecord('sn_customerservice_task');
current.addQuery('number', 'NULL');
current.query();
while(current.next()) {
var nm = new NumberManager('sn_customerservice_task');
current.number = nm.getNextObjNumberPadded();
current.setWorkflow(false);
current.update();
}

Additional Information


In future no more records will be created with empty value since we have given dictionary override for the number field with global.getNextObjNumberPadded()

Earlier check marked "Override default value" and filled "global.getNextObjNumberPadded()" in the default value on Table "sn_customerservice_task"

After dictionary override, ran following background script

var gr = new GlideRecord('sn_customerservice_task');
gr.addQuery('number', 'NULL');
gr.query();
while(gr.next()) {
gr.number = global.getNextObjNumberPadded();
gr.setWorkflow(false);
gr.update();
}

Article Information

Last Updated:2019-01-06 01:50:06
Published:2019-01-06