Find Customized Records for Any Table

Nice little script to find all customized records for any table.

Create a Script Include –

Name: getAllCustomRecords

Client Callable: True (*remember to secure your client callable script includes with an ACL*)

Script:

function getAllCustomRecords(tableName) {
    var sys_ids = [];
    var custom = false;

    var grTable = new GlideRecord(tableName);
    grTable.query();
    while (grTable.next()) {
        custom = new SncAppFiles().hasCustomerUpdate(grTable);
        if (custom == true) {
            sys_ids.push(grTable.getValue('sys_id'));
        }
    }
    return sys_ids;
}

Now go to any table you want to query for customizations, such as business rules, script includes, client scripts, etc.

Add this query to your filter

Sys ID is one of javascript:getAllCustomRecords(‘replaceWithTableName’)

Example for Business Rule Table

Sys ID is one of javascript:getAllCustomRecords(‘sys_script’)

Run the query.

You can combine this with other filters/queries to fine tune the results.

Latest Posts