How can I replicate Export as Excel in incident from list view?

ashwanikumar
Tera Expert

Hi All,

Is it possible to create a new custom UI Action on incident list view to replicate Export as an Excel?

If yes then how can I proceed?

Thanks,

Kumar

13 REPLIES 13

it dint work


Hi Ashwini,



Is it possible for you to share your code.



Thanks,


Shahnawaz Khan


Hi Ashwini,



Would it be possible for you to share your code.



Regards,


Shahnawaz Khan


Can you take a look and see what is wrong here, because its not working for me either. When I click on the UI action after I have ticked the records I want, nothing happens.

find_real_file.png

exporttoExcel();

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 = 'x_356387_taxiorder_taxi_order'; // 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;
    }
    else {
	// If the records are more then   export threshold GwtExportScheduleDialog will export the records in .xlsx format
    var dialog1 = new GwtExportScheduleDialog(tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_excel_xls');
    dialog1.execute();
}
}

 

Hi @harun.isakovic 

is it working?

Would it be possible for you to share your code .

 

Thanks,

Shradha