onCellEdit Client Script error: "View should be one of..." despite sys_ui_list record existing

anand_yadav
Mega Contributor

 

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:

JavaScript
 
// 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)

2 REPLIES 2

Brad Bowman
Kilo Patron

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.

BradBowman_0-1769004012424.png

BradBowman_1-1769004080538.png

 

Ankur Bawiskar
Tera Patron

@anand_yadav 

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! 🙏

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