
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 12:34 AM
Hello,
I have an OnChange client script is to make the user apply certain formats in a decimal field. This is the script and it works.
I want to have the same functionality in a related list.
What is the best approach to do it? A OnCellEdit client script or maybe a Business Rule?
Thank you,
Elena
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 12:39 AM
Hi,
You are on right track.
You can either use onCell Edit client script OR Before Update Business rule on that related list table
It now depends how the customer wants to see the error message since field message won't be working in onCell client script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 12:39 AM
Hi,
You are on right track.
You can either use onCell Edit client script OR Before Update Business rule on that related list table
It now depends how the customer wants to see the error message since field message won't be working in onCell client script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 01:34 AM
Hey,
I did the same thing in an onCellEdit client script but regex doesn't work. It lets me put any values in the field, that is weird.
In the end I think I will use a BR for the related list, to have the error message.
I wanted to know if that's the right track or if there are better ideas.
Thank you for the answer,
Elena
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 01:51 AM
Hi,
if the above client script is working fine then it should work fine in onCell Edit as well
You can use a business rule and show error message as good user experience.
If you use onCell Edit you can only show alert which is not a good user experience.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 03:45 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.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader