- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2019 05:19 AM
I cannot figure out why constructors new GwtPollDialog and new GwtExportScheduleDialog are both throwing these exception:
:"could not execute ui action '': ReferenceError: GwtPollDialog is not defined
could not execute ui action '': ReferenceError: GwtExportScheduleDialog is not defined.
This code works perfectly in developer instances but not in any of the onsite instances. All instances are on same patch level of Madrid. I have checked all of the parameters passed and they all return the same values in both cases.
function exporttoExcel() {
var sysparm_rows = g_list.grandTotalRows;
var num_rows = parseInt(sysparm_rows);
var selSysIds = g_list.getChecked(); // This will return the sys_id of the selected records
var sysIdList = selSysIds.split(',');
var sysparm_query = "";
for(var i=0; i<sysIdList.length; i++) {
if(sysparm_query != "") {
sysparm_query = sysparm_query +"^OR" +"sys_id=" +sysIdList[i]; // Passing sys_ids to sysparm_query
} else {
sysparm_query = "sys_id=" +sysIdList[i];
}
}
var tableName = 'incident'; // Table Name for which the records needs to be exported
var sysparm_view = g_list.view;
// If the records are less then export threshold GwtPollDialog will export the records in .xls format
if (num_rows < g_export_warn_threshold) {
var dialog = new GwtPollDialog(tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_excel_xls');
dialog.execute();
return;
}
// If the records are more then export threshold GwtExportScheduleDialog will export the records in .xlsx format
var dialog = new GwtExportScheduleDialog(tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_excel_xls');
dialog.execute();
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2019 06:15 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2019 07:21 PM
Have you checked installed plugins to make sure you arent missing one?
Have you checked the dependency related list to make sure a linkage isnt missing ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2019 07:27 PM
thank you so much for your response. I will compare both suggestions when I return to work tomorrow. Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2019 06:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 09:35 PM
Hello @Erni ,
Can we add the custom file name also to function GwtExportScheduleDialog?
As of now when we download the file, it saves with table name. file extension. So our requirement is to customize this file name instead of table name.
Best Regards,
Pooja