- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2026 01:56 AM
Hi @manju12,
This issue is happening because the function openCustomControl() is not available in the Native UI.
In Workspace, things work a bit differently; scripts can come from UI Builder or other sources, so even if the function isn’t in the UI Action itself, it may still work. But in the Native view, it strictly looks for that function inside the UI Action (or a loaded UI Script).
So when you click the button in Native UI, it tries to run openCustomControl() and fails, giving the “not defined” error.
To fix this, just make sure:
The UI Action is marked as Client = true
The same function (openCustomControl) is properly defined in the Script section of the UI Action, or available via a global UI Script
In short, I guess the function exists for Workspace but not for Native UI; that's why it breaks there.
Refer to these documents; this may help you:
https://www.servicenow.com/docs/r/application-development/ui-builder/using-ui-builder.html
If you find my answer useful, please mark it as helpful and correct. 😊
Regards,
Soham Tipnis
ServiceNow Developer || Technical Consultant
LinkedIn: www.linkedin.com/in/sohamtipnis10