function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MRDJMRDJ 

User Language in trigger before insert and before update

I need to bring the User Language (like English, Chinese, Polish) before creating a record on custom object. Whoever creates the record, that user language need to be populated on the custom object field. Can someone help me how to get user language (not local like en_US, pl) with trigger
Best Answer chosen by MRDJ
Mahesh DMahesh D
Hi MRDJ,

You can use the below code to get the User's Language:
 
UserInfo.getLanguage();

Please do let me know if it helps you.

Regards,
Mahesh

All Answers

Mahesh DMahesh D
Hi MRDJ,

You can use the below code to get the User's Language:
 
UserInfo.getLanguage();

Please do let me know if it helps you.

Regards,
Mahesh
This was selected as the best answer
Mahesh DMahesh D
More information is here:

getLanguage()
Returns the context user's language
Signature
public static String getLanguage()
Return Value
Type: String

Also look into below link:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_userinfo.htm%23apex_System_UserInfo_methods

Regards,
Mahesh