Need Dot Walking script for pop up window,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2016 12:02 AM
Hi Guys,
i have a scenario where i want "dot walking" script for pop up window.
I have written a script for pop up window as below. For That i have used onload client script.
Script:
if(g_form.getValue('d_type')=='Expected Default'){
var a = '<tTable Name>';(this is different table . I am bringing in form as a pop up.. )
var dialog = new GlideDialogForm('Please Enter RCA Details',a);
dialog.setSysID(-1);
dialog.setLoadCallback(function(iframeDoc) {
var dialogFrame = 'defaultView' in iframeDoc ? iframeDoc.defaultView : iframeDoc.parentWindow;
dialogFrame = null;
});
dialog.setDialogSize(1200,800);
dialog.render();
}
My requirement is,
i have two different form. within one form i am bringing another form as a popup. I need few values from the parent form to the pop up form as soon as the pop up form opened.
is there way to do this using dot walking or any other method. ?
Thanks in advance.
Malaisamy J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2016 06:17 AM
I think you want this line above the dialog.render() statement:
var sysID = g_form.getUniqueValue();
dialog.addParm('sysparm_query','parent=' + sysID);
where "parent" is the current incident, or parent.
Then add a display BR on your RCA table (the target table in my case) to take the values from the parent incident.
Or, do this: as per Pass values when calling a GlideDialogForm with a UI Action
dialogFrame.g_form.setValue('target field', source field);
function onLoad() {
var inc = g_form.getUniqueValue(); //the form sys_id
var desc = g_form.getValue('description'); //field we are passing to the pop up
if(g_form.getValue('d_type')=='Expected Default') {
var dialog = new GlideDialogForm('Please Enter RCA Details', 'u_rca');// setWPField);
dialog.setSysID('-1'); //Pass in -1 to create a new record
dialog.addParm('sysparm_form_only', 'true'); //Remove related lists
dialog.addParm('sysparm_query','parent=' + inc); //Set parent sys id in rca
//Callback inserts values into the Computer record after data are returned from the server
dialog.setLoadCallback(function(iframeDoc) {
var dialogFrame = 'defaultView' in iframeDoc ? iframeDoc.defaultView : iframeDoc.parentWindow;
dialogFrame.g_form.setValue('description', desc); //passing current description to the pop up
dialogFrame = null;
});
dialog.setDialogSize(1200,800);
dialog.render();
}
}
Let me know if that helps.
Harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2016 05:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2016 06:12 AM
Sure.
Just mark it as correct of you can.
Harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2016 07:04 AM
Hi Harel,
One small issue,
If i try to bring reference field value form parent to pop up window it gives me sys id value. Is there a way to rectify this issue to get the original value?
Thanks in Advance.