Skip to main content

Posts

ServiceNow reviewing skipped objects when upgrading an application

ServiceNow reviewing skipped objects when upgrading an application  goto: sys_upgrade_history_log_list.do As this is a large table to query, if you know the application name enter in this format - in this case the plugin namespace is  x_cls_clear_skye_i    which gives me something to filter on: sys_upgrade_history_log_list.do? sysparm_query=pluginSTARTSWITH x_cls_clear_skye_i %5EdispositionIN4%2C104%2C9%2C10%5Echanged%3Dtrue%5EORdisposition%3D9%5Eresolution_status%3Dnot_reviewed%5EORresolution_status%3D&sysparm_first_row=1&sysparm_view= review  ServiceNow's guide,  What’s the process to review and address skipped changes? Group skipped updates by table or type to quickly review records. By focusing on a single record type, patterns emerge and commonalities can be established. The same action may be desired for many skipped updates of the same type. Filter irrelevant records easily  For each legitimate skipped update, compare differences and det...

ServiceNow modify out of the box object or work on a copy?

ServiceNow modify out of the box object or work on a copy? see https://developer.servicenow.com/dev.do#!/guides/rome/now-platform/pro-dev-guide/pd-build-logic#modifying-default-behavior    In the past, one of the strategies used was to copy the artifact to update and to deactivate the original. The copy/deactivate approach is no longer recommended due to the following issues: Developers cannot tell if a deactivated artifact was upgraded without research. Two files, the original and the copy, need to be maintained. Maintenance doubles each time a customization is made. With each release, the customized record becomes older. Customers do not receive the enhancements included in a new release. A new release may rely on the original record being updated. Developers may make more changes to compensate for the original record being inactive. A script where only the  Active  flag is changed will be updated, but the script does not appear on the skipped list. With the copy a...

ServiceNow Arrays: check array contains a value

 ServiceNow Arrays: check array contains a value flat_file_arr.indexOf(emplNum, 0)>-1 ; //--t-map on complete script accountTableTrueUp ( import_set . number ); //accountTableTrueUp('ISET0011535'); function accountTableTrueUp ( import_set_number ) { var flat_file_arr = []; var grST = new GlideRecord ( 'x_cls_clear_skye_i_eon_hr_import' ); //--the staging table name of the transform grST . addEncodedQuery ( 'sys_import_set.number=' + import_set_number ); grST . query (); while ( grST . next ()) { flat_file_arr . push ( grST . u_employeenumber + '' ); } var grAC = new GlideRecord ( 'x_cls_clear_skye_i_account' ); grAC . addEncodedQuery ( 'account_type=5bd21b7b97db2550df843a300153af71^status=1' ); grAC . query (); while ( grAC . next ()) { var emplNum = grAC . getValue ( 'employee_number' ); var bMa...

ServiceNow Transform Maps: check if all rows in the import staging table match the target rows

 ServiceNow Transform Maps: check if all rows in the import staging table match the target rows //--t-map on complete script accountTableTrueUp ( import_set . number ); //accountTableTrueUp('ISET0011535'); function accountTableTrueUp ( import_set_number ) { var flat_file_arr = []; var grST = new GlideRecord ( 'x_cls_clear_skye_i_eon_hr_import' ); //--the staging table name of the transform grST . addEncodedQuery ( 'sys_import_set.number=' + import_set_number ); grST . query (); while ( grST . next ()) { //gs.print('employee number:' + grST.u_employeenumber); //flat_file_arr.push(grST.sys_target_sys_id+''); flat_file_arr . push ( grST . u_employeenumber + '' ); } gs . print ( 'flat_file_arr=' + flat_file_arr . toString ()); var arrStr = flat_file_arr . toString (); var grAC = new GlideRecord ( 'x_cls_clear_...

ServiceNow Accessing the import_set api in a Transform Map Script

ServiceNow Accessing the import_set api in a Transform Map Script  link:  https://developer.servicenow.com/dev.do#!/reference/api/utah/rest/c_ImportSetAPI how you could loop through target records in an onComplete t-map script: (Change the staging table name to your import set table, or alternatively use sys_import_set) var grST = new GlideRecord ( 'x_cls_clear_skye_i_eon_hr_import' ); grST . addEncodedQuery ( 'sys_import_set.number=' + import_set . number ); grST . query (); while ( grST . next ()) { gs . warn ( 'row--' + grST . sys_target_sys_id ); }

ServiceNow Random String Generator (Javascript)

ServiceNow Random String Generator (Javascript) credit gs . print ( makeid ( 4 )); function makeid ( length ) { var result = '' ; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ; var charactersLength = characters . length ; var counter = 0 ; while ( counter < length ) { result += characters . charAt ( Math . floor ( Math . random () * charactersLength )); counter += 1 ; } return result ; }