Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Can you stop the auto search on sys_m2m_template (edit member)

StephenM
Kilo Guru

When using the Edit for affected CIs on the change form the edit members automatically trys to search before a filter is put in.  This can cause long load times.  Can this be stopped?  I would like the form to wait until the run filter button is used before searching. 

2 REPLIES 2

StephenM
Kilo Guru

Giving this a bump to see if any answers in the community before creating a case.

Hi @StephenM 

you can set a default filter using list control

ChaitanyaILCR_0-1746553952115.pngChaitanyaILCR_1-1746554019276.png

 

better approach is to follow above

 

I have tried something

have a query BR on the cmdb_ci table with below script

ChaitanyaILCR_2-1746554115383.png

 

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

    var uri = gs.action.getGlideURI();

    var gr = new GlideRecord('change_request')
    if (gr.get(uri.get("sysparm_collectionID")))//comment 5 and 6 lines if you want this to extend to incident problem etc.,
        if (uri.toString().contains('sysparm_processor=M2MList') && (!uri.get('sysparm_chars') || uri.get('sysparm_chars') == '^') && uri.get('sys_target') == 'task_ci')
            current.setLimit(0);

})(current, previous);

 

let me know what vendor comes up with if case is already raised

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya