Pass parameter through dialog window to record producer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 01:34 AM
I have created an UI Action within a table which will show a pop up window of record producer.
I need to pass the record number from the opened record to the record producer variable.
how to pass value from opened record to the record producer variable?
UI Action which I have created has below script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 02:36 AM
@Ankur Bawiskar Any input on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 03:50 AM
Here are a couple of approaches from mine that you can consider to auto-populate fields when opening the com.glideapp.servicecatalog_cat_item_view UI page.
1. Define an OnLoad client script within the catalog item. Then retrieve the URI and extract the record sys_id to set the variable value accordingly
function onLoad() {
var uri = top.location.href;
var recordId = '';
if(uri.indexOf('demand.do') >= 0){ //replace the table name
var indexSysId = uri.indexOf('sys_id=') + 7;
recordId = uri.substring(indexSysId, indexSysId+32);
}
if(recordId !== ''){
g_form.setValue('ticket', recordId); //your ticket reference catalog variable
}
}
2. We customize the UI Page. Clone the UI page and modify it as follows:
HTML
<input type="hidden" id="task_sys_id" name="task_sys_id" value="${sysparm_task_id}"/>
Client Script
addLoadEvent(function(){
var taskId = $('task_sys_id').value;
g_form.setValue('variables.task', taskId);
});
UI Action
//call your customized UI page here
dialog.addParm('sysparm_task_id', g_form.getUniqueValue());
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 11:37 PM - edited 02-08-2025 11:47 PM
UI action script
create on load catalog client script