リスト表示時に日付項目の値からの経過日数を表示したい

Masaki Uehara
Tera Contributor

お世話になっています。

テーブルの一覧表示時に、ある日付項目(仮に「受付日」とします)から本日までの経過日数を表示したいと考えています。

もちろん、「経過日数」という項目を作って計算結果を入れれば良いのですが、基本的にはフォームのonloadやonsubmitトリガで「受付日」ー「本日」を計算し、定期的に「経過日数」を更新しておく必要があると思われます。

そうではなく、リスト表示時にリアルタイムに計算して表示することは可能でしょうか。

1 件の受理された解決策

Ankur Bawiskar
Tera Patron
Tera Patron

@Masaki Uehara 

you will require a field to hold the data and then show in list.

Without field it's not possible.

Why not create that field as Calculated type so that it gets calculated in real-time? then include that field in list

Don't show this field on form and make it read-only at dictionary level as it will be auto calculated

Note: Calculated field gets calculated each time for each row when list is rendered, so performance impact will be there

Calculated Fields Documentation 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

元の投稿で解決策を見る

7件の返信7

Vishal Jaswal
Giga Sage

Hello @Masaki Uehara 

Not possible. However, you can also check with ServiceNow via HI Case: https://support.servicenow.com/now 


Hope that helps!

M Ueha
Tera Contributor

Hello Vishal,

That's disappointing, but thanks for your advice. I'll check it out.

phgdet
Mega Sage

flow designer を作成して、そのフィールドが空でないすべてのレコードを検索することができます。 そのフィールドが単なる date フィールドである場合、そのフィールドが空でないレコードを取得し、0 になるまで毎日更新することができます。 それが datetime フィールドである場合、並列で待機して時間が来たらそのフィールドを更新できます。
onload と on submit は list には対応していないため、誰かが list からレコードを表示した場合には使用できません。
flow designer を使用して複数のレコードを更新する方法については、このトピックを確認してください。

Ankur Bawiskar
Tera Patron
Tera Patron

@Masaki Uehara 

you will require a field to hold the data and then show in list.

Without field it's not possible.

Why not create that field as Calculated type so that it gets calculated in real-time? then include that field in list

Don't show this field on form and make it read-only at dictionary level as it will be auto calculated

Note: Calculated field gets calculated each time for each row when list is rendered, so performance impact will be there

Calculated Fields Documentation 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader