The error occurs when the system cannot find the specified field in the object. To resolve this, try right-clicking the field and selecting "Configure Dictionary" to verify or update the field's configuration.

 

also, try this once - 

(function executeRule(current, previous) {
gs.log('Before Insert Business Rule triggered for table: ' + current.getTableName());

const userRecord = new GlideRecord('sys_user'); // Declaring the GlideRecord object with const
userRecord.addQuery('u_unique_code', '12345');
userRecord.query();

if (userRecord.next()) {
gs.log('User found with unique code 12345');
}

})(current, previous);