- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 09:02 AM
Hello everyone! I need some help with this issue.
So we have a field in the Task table (let's consider requester_name) and on Incidents I have the regular caller_id. We need to have that requester_name, because our client asked for it. When I change the caller_id in a form, I want requester_name to have the same value, and it does, even if we check the xml it is correct. But when I go back to the list, the value displayed in that column, instead of being the new one is the value it had before the update. And it goes on, like this:
On Form | On List
When created: A A
When updated first: B A
3rd update: C B
and so on....
Here is the example of the form:
And here are the values on the list:
And finally, this is the function we have on the Calculated field:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 03:36 AM
Log a Now Support case.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 06:59 AM
Yeah...it's a bit weird issue you have there... I am sure support will ask you not to use calculated value but either function field, BR or something I cant recall atm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 02:15 AM
Just to be clear with the requirement, you want "requester_name" to be same as caller_id as and when their is a change of value in the caller_id field.
If yes, have you explored On-Change Client Script on caller_id field to set requester_name ?
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 02:21 AM - edited 01-16-2024 04:09 AM
Hi Amit, thanks for the reply. Yes, that is what I want to happen. I have tried, but the same happened. It worked on the form as expected, but it didn't work for the list view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 02:43 AM
I just tested it using On-Change Client script and it is working both on list view and form view. Can you please check if your client script is as below. Also, please have a look on the screenshots.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var caller = g_form.getValue('caller_id');
g_form.setValue('opened_by',caller);
g_form.save();
}
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 04:50 AM
Yes, my code was like that and yet I still tried with yours, just in case. Still doesn't work. When I create a new record, all information is fine. The problem are just the changes. It gets delayed. My form contains certain info and the list still has the information that was on the form before.
Plus, opened by is being populated in the same form. Our second field, is a task field, extended to incidents and ritms, I'm not sure if that affects that code.