Pass values when calling a GlideDialogForm with a UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2010 03:33 PM
Im working on a UI Action that calls up a GlideDialogForm from a Catalog Task. Im using a bit of code I found here:
http://www.servicenowguru.com/system-ui/glidedialogwindow-quickforms/
function showMyForm(){
//Get the table name and sys_id of the record
var tableName = "u_token_transaction";
var tasknum = g_form.getValue('current.number');
var reqcust = g_form.getValue('current.u_requested_for');
//Create and open the dialog form
var dialog = new GlideDialogForm('Assign Token', tableName); //Provide dialog title and table name
dialog.setSysID(-1); //Pass in sys_id to edit existing record, -1 to create new record
dialog.addParm('sysparm_view', 'AssignToken'); //Specify a form view
dialog.addParm('sysparm_form_only', 'true'); //Add or remove related lists
dialog.render(); //Open the dialog
}
Heres my problem- I want to pass a couple values from the current form into the Assign Token form when it is launched. I cant find any documentation that specifies the syntax and none of my guesses seem to work. I want something that is the equivalent of
dialog.setValue('u_task_number', tasknum); (which of course doesnt work).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2017 08:27 AM
Hey,
Thanks for the awesome information.
i have one more question.
is there any way to extract the information from this form?
i just want to pick the updated fields and populate them on a different record.
any thoughts on this?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2021 04:44 AM
hi
Can you please me , I have used dialog.addParam() in my dialog form to set multiple fields but only the last line mentioned to set one of the field in the script is setting the field value not other.
Regards
Garvit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2012 08:54 PM
Create a view-specific UI Policy (Uncheck the Global and provide your View name).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2018 11:39 PM
Hi Sreed,
I know it's a quite late answer by maybe someone finds it handy for the future:
When you have an iframe in the popup and want to access field on the "bottom" form, you can use javascript like:
parent.g_form.getValue('<field_name>');