change the view of the form automatically

A Rahul
Tera Expert

We have a knowledge base(public) and the articles created under it have a different view(public) . a new module is created under knowledge menu to track/view /create knowledge articles of the KB and view rule is also created for it so that when the user comes to this module and view/create the articles the form will be displayed as per the view configured

Now the challenge is for example if the user want to create a new article not from the created module in general if the user goes to my knowledge articles menu ->new-> select KB-> and fill the form and submit the view will be default only 

so the clients have asked us to change the view when ever the user selects the knowledge base as public the view of the form should be public only

for example if the user make the filter knowledge base as public and if he click on the new button the form which displays should not be default one

for this i am trying to create a on change client script for the knowledge base field on change of the  knowledge base field the view view should be changed  and also on load of the form for the knowledge base =public the form should be public view please do help us in achieving this requirement

 The view rule i have created works for only the new module we have created it is not working when ever we keep the filter condition knowledge base=public

find_real_file.png

6 REPLIES 6

Sohail Khilji
Kilo Patron
Kilo Patron

Hi,

we can achieve the functionality by onload client script.

we have "switchView" function to Achieve that.

switchView(type,table,view);

 

Ex:

function onLoad() {
   
   if(knowledge_base == 'xxxxxx'){

      switchView('section','kb_knowledge',yyyy_view');

   }
}

 

 


Thanks,

Sohail Khilji

Kindly mark the answer correct or helpful if it addresses your concern....


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi sohail khilji,

 

I tried that but no luck in the list i have made the filter as knowledge base = name and run the filter and clicked on new but still it did not show the view

find_real_file.png

SumanthDosapati
Mega Sage
Mega Sage

Hi Rahul,

This article might solve your query.

Changing form view

 

Regards,

Sumanth

Hi sumanth ,

i tried the above as well the onchange script but it did not work