- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2017 05:59 AM
I have created a UI action to fetch a field in RITM catalog variables and show in Glidedialogwindow and when user enters value it needs to be updated in the field.
Using below steps:
Ui Action of client type:
function updateInput(){
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var dialog = new dialogClass("change_value_popup");
//dialog.setWidth("800");
dialog.setTitle(getMessage("Change the value with appropriate"));
dialog.setPreference('sysparm_sys_id', g_form.getUniqueValue());
dialog.render(); //Open the dialog.
}
===========================================================================================================
UI Page XML:
<?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:evaluate var="group_mailbox"
expression="RP.getWindowProperties().get('current.variables.mailbox')" />
<tr>
<td class="label">
${gs.getMessage('Please provide appropriate value:')}
</td>
<td>
<g:ui_input_field name="mailbox_name" id="mailbox_name" label="Group Mailbox Name" value="${group_mailbox}"
/>
</td>
</tr>
<tr>
<td>
<g:dialog_button id="submit_button" type="submit"
onclick="entervalue('${sysparm_id}', this)">${gs.getMessage('Submit')}</g:dialog_button>
<g:dialog_button id="cancel_button" type="submit"
onclick="closevalueWindow(this)">${gs.getMessage('Cancel')}</g:dialog_button>
</td>
</tr>
</j:jelly>
Ui Page Client Script:
function closevalueWindow() {
GlideDialogWindow.get().destroy();
}
function entervalue() {var groupmailbox = gel("mailbox_name").value;
alert(groupmailbox);
if (groupmailbox == "") {
alert("Please enter your value before submitting.");
return false;
}
var req_item = g_form.getUniqueValue();
alert(req_item);
var ga = new GlideAjax('AutomationUtils');
ga.addParam('sysparm_name', 'Changevalue');
ga.addParam('sysparm_sysid',req_item);
ga.addParam('sysparm_groupmailbox',groupmailbox);
ga.getXMLAnswer(getresponse);
function getresponse(answer){
closevalueWindow();
g_form.save();
}
}
==============================================
Script Include function:
Changevalue: function() {
var mailbox = this.getParameter('sysparm_groupmailbox');
var sysid = this.getParameter('sysparm_sysid');
var req = new GlideRecord('sc_req_item');
req.get('sysid');
req.variables.mailbox = mailbox;
req.update();
return true;
new Workflow().broadcastEventToCurrentsContexts(req, 'update', null);
},
This is failing on the update of catalog variable in RITM.
The need here is to allow the appropriate catalog variable to be shown on Glidedialogwindow for certain selection when Request was submitted(i have not yet gone to the part of querying based on selection bit) and the popup to accept the value and update the variable and workflow to be restarted from that point.
Appreciate your response.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2017 09:53 AM
I am using g_form.setValue('variable name', value) and this is working to set my solution.
Thanks for your time and help Kristen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2017 07:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2017 09:53 AM
I am using g_form.setValue('variable name', value) and this is working to set my solution.
Thanks for your time and help Kristen.