Javascript on an interactive filter ?
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 07:58 AM
Good morning all,
I'm here to ask you if, on a dashboard, it's possible to use a javascript to add an additional filter on a interactive filter, such as the option "advanced" of a "Reference Specification" for a form.
The current filter is created with a "cascade filter" and there is only the option to filter according to a specific filter.
Thanks in advance,
Domenico
- Labels:
- 
						
							
		
			Scripting and Coding
 
					
				
		
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 10:58 AM
yes, you can add custom interactive filter to add JS in script include.
Regards,
Sachin
 
					
				
		
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 11:11 AM
Hi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2020 01:46 AM
Hi all. Many thanks for your help but I'm a bit lost because i don't find the correspondences between the guides and my interface.
I have to create an interactive filter with this javascript code, already used on a form
var Confirmed_Owner_dep_contain = Class.create();
Confirmed_Owner_dep_contain.prototype = {
    initialize: function() {
    },
	
	getValue: function(){
	var ownerDepts = [];
	var userRec = new GlideRecord('sys_user');
    userRec.get(gs.getUserID());
	//gs.print(userRec.name);
	var var_department = userRec.department;
	//gs.print('dept: ' + var_department);
	
	//Recupero della struttura di coordinamento associata al dipartimento dell'utente
	var coord1 = new GlideRecord('sn_audit_containment_coordination');
	coord1.addQuery('u_owner_dept', var_department);
	coord1.query();
	if(coord1.next()){
	//gs.print('coord1: ' + coord1.u_owner_dept.name);
	//gs.print('coord1: ' + coord1.u_coordinator_dept.name);
					
	//Recupero dei dipartimenti associati alla struttura di coordinamento dell'utente
	var coord2 = new GlideRecord('sn_audit_containment_coordination');
	coord2.addQuery('u_coordinator_dept', coord1.u_coordinator_dept);
	coord2.query();
	//gs.print('count: ' + coord2.getRowCount());
	while(coord2.next()){
		ownerDepts.push(coord2.u_owner_dept.toString());
		//gs.print(coord2.u_owner_dept);
	}
		//gs.info( ownerDepts.join(',').toString());
		return 'sys_idIN' + ownerDepts.toString(); //join(',');
	}	
	
	return '';
},
    type: 'Confirmed_Owner_dep_contain'
};
Currently, i have this interactive filter on the field "u_confirmed_owner_dept" of the table "Remediation Action" , but the list box drop down all records. I wish that this list will be filtered by the Javascripts logic (already used and working on a form).
