- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2018 12:39 AM
Hi ,
I have used following code to open the dialog form, now how can I pass the current from value to Dialog form ? Please suggest? Thanks in advance.
UI Action code ->
function publish() {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var gDialog = new GlideDialogForm('MM ITAM', 'pc_software_cat_item',dothis); //Provide dialog title and table name
gDialog.render();
}
//this is my callback function. All I am doing is taking the sys_id and using the setValue to place it in the caller_id field.
function dothis(action, sys_id, table, displayValue) {
g_form.setValue('product_catalog_item', sys_id);
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2018 02:27 AM
hi, kambleneeta20@gmail.com
if need to pass values into the dialog from original form, in this case need to set a callback function to pass and set those values into dialog like this:
function publish() {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var gDialog = new GlideDialogForm('MM ITAM', 'pc_software_cat_item',dothis); //Provide dialog title and table name
gDialog.setLoadCallback(function(iframeDoc) {
// To get the iframe: document.defaultView in non-IE, document.parentWindow in IE
var dialogFrame = 'defaultView' in iframeDoc ? iframeDoc.defaultView : iframeDoc.parentWindow;
dialogFrame.g_form.setValue('name', g_form.getValue('your_fieldName'));
});
gDialog.render();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2018 02:27 AM
hi, kambleneeta20@gmail.com
if need to pass values into the dialog from original form, in this case need to set a callback function to pass and set those values into dialog like this:
function publish() {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var gDialog = new GlideDialogForm('MM ITAM', 'pc_software_cat_item',dothis); //Provide dialog title and table name
gDialog.setLoadCallback(function(iframeDoc) {
// To get the iframe: document.defaultView in non-IE, document.parentWindow in IE
var dialogFrame = 'defaultView' in iframeDoc ? iframeDoc.defaultView : iframeDoc.parentWindow;
dialogFrame.g_form.setValue('name', g_form.getValue('your_fieldName'));
});
gDialog.render();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2018 05:44 AM
Thanks a lot. It worked.