Set Language field value according to user lang.

Varsha21
Giga Guru

Hi Experts,

 

want to set language field value according to logged in users language,on kb_knowledge form,

e.g if logged in useres lang is English then it should be Englisg

and if Spanish then it should be Spanish.

 

Please help me out here, and tell me good way to do.

 

Regards,

Varsha

1 ACCEPTED SOLUTION

Chandra Prakash
Tera Expert

Hi Varsha,

You can use configure dictionary on "language" field in "kb_knowledge" table as below

 

                                                     find_real_file.png

 Then go to Default Value tab, check Use dynamic default check box and create new dynamic value in "sys_filter_option_dynamic" table.

 

find_real_file.png

 

find_real_file.png

 

Hope it will help you, Let me know if you find any issues.

Mark Correct or Helpful if it is so

 

 

View solution in original post

4 REPLIES 4

Chandra Prakash
Tera Expert

Hi Varsha,

You can use configure dictionary on "language" field in "kb_knowledge" table as below

 

                                                     find_real_file.png

 Then go to Default Value tab, check Use dynamic default check box and create new dynamic value in "sys_filter_option_dynamic" table.

 

find_real_file.png

 

find_real_file.png

 

Hope it will help you, Let me know if you find any issues.

Mark Correct or Helpful if it is so

 

 

Hi Chandra Prakash,

you can also share the Dynamic default form, to configure 'My Language' in case if that record is not available for everyone by default. 

Regards, Akash

Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.

Akash4
Kilo Sage
Kilo Sage

Hi Varsha,

You can write an onLoad Client Script for this on kb_knowledge form. Here is a sample script which you can extend based on your requirement.

Assuming my kb_knowledge field as 'u_language', as shown:

find_real_file.png

function onLoad() {
   //Type appropriate comment here, and begin script below
   var getUserLang = g_user.getUserID().preferred_language;
	if (getUserLang){
	g_form.setValue('u_language',getUserLang);
		return;
	}
	g_form.setValue('u_language','en'); //if user has no language, set english
}

Thanks, Akash

Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.

Hi Akash,

Actually here Language is OOB field which is referring the user's language. If you will create it manually then for every different language you need to insert a choice every time.

Regards,

Chandra Prakash