Рет қаралды 693
Hello Everyone,
We have created one use case video on List Action to export the selected records only in PDF formate. Basically the List action is created for the UI builder workspaces to perform any action on the list.
Now @servicenow has OOB Export button but that exports all the records present on the list view but we want the selective records only, So in order to fullfill this requirement we are creating the dynamic URL and hitting that from List Actions.
// Code from List Action :
function onClick() {
try{
var checkedRecords= g_list.getChecked();
var query="sys_idIN"+checkedRecords.toString();
var table= g_list.tableName;
var view= g_list.getView();
var url=table+"_list.do?PDF&sysparm_query="+query+"&sysparm_view="+view+"&sysparm_view=print&landscape=true";
top.location.href=url;
}catch(ex){
var message=ex.message;
alert("Errors:"+message);
}
}
Tags :
#servicenow #servicenowimplementation #Uibuilder #servicenowtraining