onCellEdit Client Script error: "View should be one of..." despite sys_ui_list record existing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Community,
I am facing a strange validation error when saving an onCellEdit Client Script. I'm hoping someone can point out if there's a specific cache or hidden property I'm missing.
The Issue: I am trying to restrict an onCellEdit script to a specific custom view named abcdef on my custom table u_laptop_issues. When I uncheck Global and select the view, I get the error:
"View should be one of [extraview], otherwise select the table or check the Global box"
The Evidence: I have verified that the metadata is correct using a background script. The system does have a valid list layout for this table/view combination:
// Background Script Result: *** Script: *** SUCCESS: Found a list layout for table "u_laptop_issues" in view "abcdef". *** Script: *** List Record Sys ID: e41b658683ae3210f21ec070ceaad33c
What I've Tried:
Confirmed all records (Table, View, Script) are in the same Application Scope.
Confirmed the internal name of the view is exactly abcdef.
Successfully used the abcdef view in the actual UI list of the table.
Ran cache.do to clear platform cache.
Toggled the Table field on the Client Script to try and force a refresh.
Why would the Client Script validator fail to recognize a view that clearly exists in sys_ui_list? Is there another table the validator checks besides sys_ui_list?
Current Environment Version: Zurich (latest release)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
When I do something similar and type whatever value for the view, it gives me the internal names of views that I have created. What happens when you put 'extraview' here - or is this a known different view? In any case, it only thinks you have created one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
onCell edit works on list.
why are you giving view?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
@Ankur Bawiskar
Well, your response actually make sense to me and that's what I was thinking while I was encountering the issue that I have mentioned. But in the new Client Script form, on unchecking the Global checkbox, a View field appears which is also mandatory.
And what am I trying to do actually make sense as if I want to apply an onCellEdit only on a particular view of a list and not globally then it should work.
I am not sure if it is allowed to do in ServiceNow platform or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
If a view exists for a list, I should be able to apply onCellEdit for the list for that particular view. That's all I want to do.
