- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 10:59 PM
I'm trying to open a UI page on clicking of a UI Button on the incident form and it has a input text field so that user can enter the bridge URL and I want to access it in the Server side script because I'm able to access it in client script of UI page as below. Also, is there any way we can send current object from UI action to UI page and access them in both client and processing script?
UI action:
UI Page:
Solved! Go to Solution.
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2022 10:24 PM
Hi,
you can pass sysId to UI page from UI action and then get it inside processing script
Remember you need to use g:ui_form to submit the UI page for the processing script to run
Sample below
UI Action:
dialog.setPreference('sysid', g_form.getUniqueValue());
UI Page HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<g:evaluate var="jvar_sysid"
expression="RP.getWindowProperties().sysid"/>
<g:dialog_buttons_ok_cancel cancel="return onCancel();" ok="return onSubmit();"/>
<input type="hidden" id="task_sys_id" name="task_sys_id" value="${jvar_sysid}"/>
</g:ui_form>
</j:jelly>
Processing script:
var taskSysId = task_sys_id;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2022 10:24 PM
Hi,
you can pass sysId to UI page from UI action and then get it inside processing script
Remember you need to use g:ui_form to submit the UI page for the processing script to run
Sample below
UI Action:
dialog.setPreference('sysid', g_form.getUniqueValue());
UI Page HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<g:evaluate var="jvar_sysid"
expression="RP.getWindowProperties().sysid"/>
<g:dialog_buttons_ok_cancel cancel="return onCancel();" ok="return onSubmit();"/>
<input type="hidden" id="task_sys_id" name="task_sys_id" value="${jvar_sysid}"/>
</g:ui_form>
</j:jelly>
Processing script:
var taskSysId = task_sys_id;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 12:12 AM
Hi, Please check below link if it will help you
https://community.servicenow.com/community?id=community_question&sys_id=76bbe0a1db75b454ddb1d9d9689619ee