Skip to main content

ServiceNow Nice little html table in catalog item description

 ServiceNow html table in catalog item description

<p>This item is for maintenance and additions of Cost Centres </p> <p>The codes covered by this item are between xxxx and zzzz. If the code you are looking to add/update is not within this range please go to one of the following items:&nbsp;</p> <table style="border-collapse: collapse; width: 742px; height: 209px;" border="0" width="743" cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 14.5pt;"> <td style="height: 14.5pt; width: 221pt; font-size: 11pt; color: white; font-weight: bold; font-family: Calibri; border-width: 1pt 1pt 0.5pt; border-style: solid; border-color: windowtext windowtext #8ea9db; background: #4472c4; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;" width="295" height="19">Estate</td> <td style="width: 102pt; font-size: 11pt; color: white; font-weight: bold; font-family: Calibri; border-width: 1pt 1pt 0.5pt; border-style: solid; border-color: windowtext windowtext #8ea9db; background: #4472c4; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;" width="136">Code Range</td> <td style="width: 234pt; font-size: 11pt; color: white; font-weight: bold; font-family: Calibri; border-width: 1pt 1pt 0.5pt; border-style: solid; border-color: windowtext windowtext #8ea9db; background: #4472c4; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;" width="312">Catalogue Item Link</td> </tr> <tr style="height: 14.5pt;"> <td style="height: 14.5pt; font-size: 11pt; font-family: Calibri; border-width: 0.5pt 1pt; border-style: solid; border-color: #8ea9db windowtext; background: #d9e1f2; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;" height="19">item 1</td> <td style="font-size: 11pt; font-family: Calibri; border-width: 0.5pt 1pt; border-style: solid; border-color: #8ea9db windowtext; background: #d9e1f2; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;">1111 - 2222</td> <td style="font-size: 11pt; font-family: Calibri; border-width: 0.5pt 1pt; border-style: solid; border-color: #8ea9db windowtext; background: #d9e1f2; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;"><a title="item 1 Cost Centres" href="https://<instance>.service-now.com/sp?id=sc_cat_item&amp;sys_id=a07f971cdb06b7081b4ffc45ae9xxxxx&amp;sysparm_category=a9c6ff9fdbdad780edfc7cbdae9xxxxx" rel="nofollow">item 1 cost centers</a></td> </tr> <tr style="height: 14.5pt;"> <td style="height: 14.5pt; font-size: 11pt; font-family: Calibri; border-width: 0.5pt 1pt; border-style: solid; border-color: #8ea9db windowtext; background: #d9e1f2; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;" height="19">item 2</td> <td style="font-size: 11pt; font-family: Calibri; border-width: 0.5pt 1pt; border-style: solid; border-color: #8ea9db windowtext; background: #d9e1f2; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;">2222 - 3333</td> <td style="font-size: 11pt; font-family: Calibri; border-width: 0.5pt 1pt; border-style: solid; border-color: #8ea9db windowtext; background: #d9e1f2; padding-top: 1px; padding-right: 1px; padding-left: 1px; vertical-align: bottom; border-image: initial; white-space: nowrap;"><a title="item 1 Cost Centres" href="https://<instance>.service-now.com/sp?id=sc_cat_item&amp;sys_id=a07f971cdb06b7081b4ffc45ae9xxxxz&amp;sysparm_category=a9c6ff9fdbdad780edfc7cbdae9xxxxz" rel="nofollow">item 2 cost centers</a></td> </tr> <tr style="height: 14.5pt;"> <!-- etc etc --> </tr> </tbody> </table>

Comments

Popular posts from this blog

Get URL Parameter - server side script (portal or classic UI)

Classic UI : var sURL_editparam = gs . action . getGlideURI (). getMap (). get ( ' sysparm_aparameter ' ); if ( sURL_editparam == 'true' ) { gs . addInfoMessage ( 'parameter passed ); } Portal : var sURL_editparam = $sp . getParameter ( " sysparm_aparameter " ); if ( sURL_editparam == 'true' ) { gs . addInfoMessage ( 'parameter passed ); }

ServiceNow check for null or nil or empty (or not)

Haven't tested these all recently within global/local scopes, so feel free to have a play! option 1 use an encoded query embedded in the GlideRecord , e.g.  var grProf = new GlideRecord ( 'x_cls_clear_skye_i_profile' ); grProf . addQuery ( 'status=1^ owner=NULL ' ); grProf . query (); even better use the glideRecord  addNotNullQuery or addNullQuery option 2 JSUtil.nil / notNil (this might be the most powerful. See this link ) example: if ( current . operation () == 'insert' && JSUtil . notNil ( current . parent ) && ! current . work_effort . nil ())  option 3 there might be times when you need to get inside the GlideRecord and perform the check there, for example if the code goes down 2 optional routes depending on null / not null can use gs.nil : var grAppr = new GlideRecord ( 'sysapproval_approver' ); var grUser = new GlideRecord ( 'sys_user' ); if ( grUser . get ( 'sys_id' , current . approver )){