1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[ServiceNow]Formに拡張先の項目を配置する。

Posted at

#概要
 ServiceNowは、テーブルの拡張という考え方を持っており、共通項目は拡張元のテーブルに、独自の項目は拡張先テーブルにのみ存在する。
 Reference項目で、拡張元のテーブルを参照しているが、拡張先のテーブル項目も画面に表示する、ということができる。

##詳細
 例えば、HardWare資産の画面に、紐づく構成情報のOS、OSドメイン等の情報を見えるようにする。
 [Hardware資産]
 image.png

 [CMDB(構成情報)]
 image.png

 OSの情報は、「ci」のテーブルには存在せず、「cmdb_ci_computer」に存在する項目である。
image.png

 HardwareのConfigurationItemは、基底の「ci」テーブルとのReferenceとなっている。
image.png

HardwareのForm LayoutではOS情報が表示されない。
image.png

##表示のさせ方
1.System UI>Viewsから、該当のViewを開き、追加したいSectionのFormSectionを開く

2.Section Elementに、今配置している項目が出る。FormLayoutで設定されている内容がそのまま出てくる

 image.png

3.「New」で、表示したい項目を直接指定する。
書き方は、「reference項目.ref_参照したいテーブル名.項目名」という書き方。
  今回はHardwareから見て、OSを表示したいので、「ci.ref_cmdb_ci_computer.os」となる。
image.png

4.(念のため)Form Section、UI View自体のUpdateを行い、cacheをクリアする。

これで、表示されるようになる(・ω・)/
image.png

このまま、Form Layoutを見てみるとComputerから参照されていることがわかる。
image.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?