- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2025 02:56 AM
I have a Requirement Regarding Ui Page and Ui Action
But is Not working correctly
Ui Page
and my UI ACtion is
and it not displaying the alert message and in console also it displaying some error msg
validate owner is notdefined
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2025 09:31 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2025 03:03 AM
Hi @LokeshwarRV
What is your requirement?
Are you trying to open the UI page when someone clcks the UI action?
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2025 03:11 AM
your script is wrong. validateOwner function should be within UI page and not in UI action
try this and it will give you alert
HTML:
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide">
<div class="form-group form-horizontal">
<div class="col-md-4 text-right">
<g:form_label>
${gs.getMessage('Choose ITSLT')}
</g:form_label>
</div>
<div class="col-md-8">
<g:ui_reference name="itslt_ref_field" query="active=true" table="sys_user" />
</div>
</div>
<g:dialog_buttons_ok_cancel ok="return validateOwner()" />
</j:jelly>
Client Script:
function validateOwner() {
alert("Nikhitha");
var itslt = document.getElementById('itslt_ref_field');
if (itslt) {
alert(itslt.value);
// Use GlideAjax or g_form from parent if required, else send value to server or return as dialog result
// Example: pass back the value
// window.opener.g_form.setValue('u_htas_itslt_owner', itslt.value); <--- only works in popups, not GlideModal
return true;
} else {
alert('Could not find ITSLT field');
return false;
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2025 09:31 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader