The CreatorCon Call for Content is officially open! Get started here.

How to restrict the option in reference filed on the selection of choice in another field

vinitaraico
Tera Contributor

Hi Team,

 

we have multiple active knowledge base 

I have created a new field on kb_knolwedge form.  On selection of this new filed ,I am populating value in knowledge base filed .

 

new field is "End User Article" Type -choice ->Yes/No

existing field  "Knowledge base " is a reference field -  also There is a dynamic filter (Get Default Knowledge Base) to get all  active knowledge bases

 

Now on selection of Yes  ,I am setting  knowledge base field value   "abc"

On selection of No - Knowledge base is showing all active knowledge bases ,including "abc" knowledge base ,How can I remove it from the list? I should not want "abc" to visible  when  selection of "No"

 

 

 

 

 

 

6 REPLIES 6

SumithraM
Tera Expert

Hi @vinitaraico , 

 

For Achieving this more efficiently, you can update the Reference qual of the Dictionary to something below - 

var ret='';if(current.<your_custom_field_name> == 'yes') ret='title=abc';else ret='title!=abc;ret


Though you will have a script to Auto populate Knowledge Base with 'abc' upon selection yes, you can restrict showing values for both cases 'yes' and 'no'.

 

SumithraM_1-1751003655790.png

OOTB reference Qualifier already set I tried customize Query BR which we are calling in Dynamic filter but not working

// if there is only one active KB, return it
function getDefaultKB() {

     var sysIdArray = ['da4bd9d5dba997408b0f9ec6db9619f5','75fb7da5db0d3c588f092161ca9619a8'];
var d=new GlideRecord('kb_knowledge');
      if(current.u_end_user_article =='no')
{
  var gr = new GlideRecord('kb_knowledge_base');
    gr.addQuery('active', 'true');      
  gr.query();
  if(gr.getRowCount()==1 && gr.next()) {

    
    return sysIdArray;


   
  } }  
}

 

vinitaraico_0-1751035009300.png