Before you configure left padding of number fields on a custom table or a table that
does not extend the task table, you must prepare business rules and script
includes.
始める前に
Role required: admin
手順
-
Duplicate the base system business rule named Pad Numbers:
Click Insert and Stay.
If Insert and Stay is not available on your
instance, create a new business rule and manually copy all field values from Pad
Numbers.
-
Give the business rule a new name and change the script field to read as
follows:
padCurrentCategory();
function padCurrentCategory() {
var target = new GlideRecord(current.category+"");
if (!target.isValidField("u_number") || target.isValidField("number")) return;
var nm = new UNumberManager();
nm.padTableNumbers(current.category, current.maximum_digits);
};
-
Save the changes.
-
Duplicate the base system script include named
NumberManager.
-
Change the following two lines as indicated:
105: currentNumber = records.u_number.toString();
117: records.u_number = prefix + currentNumber;
-
Name the new script include UNumberManager and save your
changes.
You can now continue with the process of configuring left-padding and
renumbering records.