Ui Action button is not working in UI native
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Team,
I have one Reject button created in UI action, this button is working in workspace but same button is not working in native View.. It is throwing undefined onclick.. Shared the screenshot below. Please help me out..
Thanks,
Manju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @manju12 ,
The error openCommentForControl is not defined clearly indicates that the function used in your UI Action onclick is not available in Native UI, even though it works in Workspace.
Root Cause
The function is likely defined in Workspace (UI Builder / Client Script)
Native UI does not load those scripts
Hence, onclick fails with undefined function
Step-by-Step Solution
Step 1: Check UI Action Configuration
Go to System Definition → UI Actions
Open your Reject button
Verify:
Client = true
Onclick:
openCommentForControl();Step 2: Create Client Script for Native UI
Go to System Definition → Client Scripts
Click New
Configure:
Table: same as your UI Action table
Type: onLoad
Step 3: Define the Function
Add this script:
var comment = prompt("Enter rejection comments:");
if (comment) {
g_form.setValue('comments', comment);
}
}
This makes the function available in Native UI
Step 4: Test the Button
Open the record in Native UI
Click Reject
It should now:
Prompt for comment
Populate the field
