Using sysparm_fixed_query in URL

Karishma5
Tera Expert

Hello all, 

I have a requirement,  where we go to the user from > groups related list > edit button

In the edit member page I need to filter the groups with type - 'itil'. User should not be able to edit this filter, but can add more filter conditions if required. I tried using sysparm_query in URL but that is editable. 

find_real_file.png

I think it can be done with sysparm_fixed_query. But unfortunately not working. Am I using it in a wrong way?

Can anyone help me with this or provide me with suggestion on this.?

 

Thanks in advance,

Karishma

1 ACCEPTED SOLUTION

Shweta KHAJAPUR
Tera Guru

Try below code in before Query BR,

(function executeRule(current, previous /*null when async*/) {


	gs.addInfoMessage('test URL....   '+gs.action.getGlideURI());//.get('sysparm_collection')) ;//.toString().indexOf('Search String')
//	=
	if(gs.action.getGlideURI().get('sys_target')=='sys_user_grmember' && gs.action.getGlideURI().get('sysparm_type')=='M2MList' && gs.action.getGlideURI().get('sysparm_processor')== 'M2MList'){
		current.addEncodedQuery('typeLIKE1cb8ab9bff500200158bffffffffff62');
	   
	   }
})(current, previous);

View solution in original post

6 REPLIES 6

Shweta KHAJAPUR
Tera Guru

Try below code in before Query BR,

(function executeRule(current, previous /*null when async*/) {


	gs.addInfoMessage('test URL....   '+gs.action.getGlideURI());//.get('sysparm_collection')) ;//.toString().indexOf('Search String')
//	=
	if(gs.action.getGlideURI().get('sys_target')=='sys_user_grmember' && gs.action.getGlideURI().get('sysparm_type')=='M2MList' && gs.action.getGlideURI().get('sysparm_processor')== 'M2MList'){
		current.addEncodedQuery('typeLIKE1cb8ab9bff500200158bffffffffff62');
	   
	   }
})(current, previous);

Thanks shweta! This worked like charm 🙂