- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 05:16 AM
In a table "A" there are two fields., namely Field A, Field B.
Field A = State
Field B = Resolved Date
-> If STATE changes to "Resolved" then I need to update the RESOLVED DATE as current date/time.
I want to achieve it through "Function field" instead of using Business rule or UI Policy or something..
Can someone please help on this ? @Ankur Bawiskar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 05:59 AM
calculated field calculate every time a row is read.
So if you open incident list and it has 100 rows then the calculated field calculation will be performed 100 times.
I won't recommend doing this.
Since you just want to store then why not use before update business rule and store the current time in custom field.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 05:51 AM
Will it work for existing records also?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 05:59 AM
calculated field calculate every time a row is read.
So if you open incident list and it has 100 rows then the calculated field calculation will be performed 100 times.
I won't recommend doing this.
Since you just want to store then why not use before update business rule and store the current time in custom field.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 06:03 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 06:10 AM - edited 02-14-2025 06:18 AM
Can we use something like below in order not to execute at every time?
There are some other methods also exist in the BR, that's an after BR.. and that BR is calling OOB script include and there has some update operation.. so I don't want to touch OOB, and for this simple thing I don't want to use another new BR.
(function calculatedFieldValue(current) {
var answer = '';
if(current.resolved_time == '')
{
if (current.state == 6) // 6 is the 'Resolved' state
{
answer = new GlideDateTime();
return answer;
}
else
{
return answer;
}
}
return answer;
})(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 06:22 AM
calculated field is out of picture due to performance impact.
Why not use flow designer which can run on record update?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader