Name
global.DbImageNameCheck
Description
Receives a parameter name and determine whether a db_image record exists with the same name.
Script
var DbImageNameCheck = Class.create();
DbImageNameCheck.prototype = Object.extendsObject(AbstractAjaxProcessor, {
process: function() {
var name = this.getName();
var gr = new GlideRecord('db_image');
gr.addQuery('name', name);
gr.query();
var exists = "false";
if (gr.next())
exists = "true";
var item = this.newItem("match");
item.setAttribute("exists", exists);
},
type: "DbImageNameCheck"
});
Sys ID
facb3ceb0a0a0b2e00bdcf7001cc0c11