Posts

Showing posts from July, 2018

Hello London!

London release https://docs.servicenow.com/bundle/london-release-notes/page/release-notes/summary/rn-summary-new-features.html

Theme a sub-production instance: different header colors

system property: css.$navpage-header-bg for example, dev value might be:  #5A25BB uat value might be:  #4E9F39 this can be edited via system properties> basic configuration UI16

TechNow vids

https://www.youtube.com/watch?v=8cMxVZMz5CA&list=PLkGSnjw5y2U7HkJd7YkVtX93pA5pl8KDM

All the TechNow vids in one place! (well...up to no. 26)

https://www.youtube.com/playlist?list=PLCOmiTb5WX3ouggdJ4ty2dVUSrki9uYr1

Preserving integrations credentials

In addition to data preservers, consider the credential & alias features that Kingston makes available: https://docs.servicenow.com/bundle/kingston-release-notes/page/release-notes/it-operations-management/credentials-rn.html https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/product/discovery/concept/connection-alias.html https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/product/discovery/reference/connection-information.html

Scripted REST best practice principles

https://developer.servicenow.com/app.do#!/document/content/app_store_doc_scripted_rest_kingston_scripted-rest-dev-portal-container?v=kingston

Table: delete all records

https://docs.servicenow.com/bundle/jakarta-platform-administration/page/administer/table-administration/task/t_DeleteAllRecordsFromATable.html

Useful tableutil features. Proceed with caution!

https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/TableUtils/concept/c_TableUtilsAPI.html

System maintenance: clear down email logs on sub-production

//--NOT TO BE RUN ON PRODUCTION var gr = new GlideRecord ( 'sys_email' ); gr . addQuery ( 'type!=received^ORtype=NULL' ); //gr.query(); //gs.print(gr.getRowCount()); gr . deleteMultiple ()

Client script: make all editable fields read only under certain conditions

A write ACL is the ideal solution, but if for some reason this logic had to happen in a client script here is an (undocumented) solution: var fields = g_form . getEditableFields (); for ( var x = 0 ; x < fields . length ; x ++) {         g_form . setReadOnly ( fields [ x ], true ); } Seems to have left the worknotes editable on the form I tried it on which could be quite neat if that is the only field that should be editable. will not work on mandatory fields if these are empty

Get the table name based on ticket number

getTableName : function ( ticketNumber ){         var tableName = '' ;         var ticketPrefix = ticketNumber . replace ( /\d*/g , '' );         if ( ticketPrefix == 'INC' ){             tableName = 'incident' ;         }         if ( ticketPrefix == 'PRB' ){             tableName = 'problem' ;         }         if ( ticketPrefix == 'PRB' ){             tableName = 'problem' ;         }         if ( ticketPrefix == 'CHG' ){             tableName = 'change_request' ;         }         if ( ticketPrefix == 'REQ' ){             tableName = 'sc_request' ;         }         if ( ticketPrefix == 'RITM' ){             tableName = 'sc_req_item' ;         }         if ( ticketPrefix == 'CTASK' ){             tableName = 'change_task' ;         }         if ( ticketPrefix == 'TASK' ){