Calling Script Include function in Argument of module to filter list of records is not working

Krishnakant Arv
Tera Expert

Hi Developers,

 

Need your help in calling Script Include function in Arguments of Link Type (URL from Arguments) in a module to filter list of records based on logged user groups.

 

Actually my other function in Argument is working fine but I have added new function & it is not working.

 

Arguments - /table_name_list.do?sysparm_fixed_query=u_payment_type=XYZ^u_status!=Deleted^u_user_countryINjavascript:new Terminationerhruser().getCountryRequests('single')^u_is_avanade_creatorINjavascript:new Terminationerhruser().getAvanadeRequests('single')^javascript:new Terminationerhruser().getHrPartner();

 

Highlighted part is newly added and that only not working properly. Others functions are working exactly fine.

 

Script Include code :- 

getHrPartner: function() {
        var query;
        if (gs.getUser().isMemberOf('abc')) {
            query = 'u_hr_partner_creator=true';
        } else {
            query = 'u_hr_partner_creator=false';
        }
        return query;
    },
 
Filter Condition currently getting - 
 KrishnakantArv_1-1710066940093.png

 

Expected - 
KrishnakantArv_0-1710066686414.png

 

Thanks in Advance,

 

 

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@Krishnakant Arv Could you please try updating the code as follows and see if it works.

 

Arguments - /table_name_list.do?sysparm_fixed_query=u_payment_type=XYZ^u_status!=Deleted^u_user_countryINjavascript:new Terminationerhruser().getCountryRequests('single')^u_is_avanade_creatorINjavascript:new Terminationerhruser().getAvanadeRequests('single')^u_hr_partner_creator=javascript:new Terminationerhruser().getHrPartner();

 

Script Include:

 

getHrPartner: function() {
        var query;
        if (gs.getUser().isMemberOf('abc')) {
            query = 'true';
        } else {
            query = 'false';
        }
        return query;
    },

Hi @Sandeep Rajput ,

 

Thanks for you reply on my query.

 

I tried above changes but still it's not working. Filter condition I am getting -

 

Other Filter condition >HR Partner Creator = javascript

 

Please let me know what else I can do to make it correct.

 

Thank You So Much

Krishnakant.