Thursday, August 8, 2019

How to get Language of logged-in user in JavaScript in dynamic CRM


You can get the user's locale ID through the function

Xrm.Page.context.getUserLcid()

Below is a sample code to flash a message to user according to his language preference

if (Xrm.Page.context.getUserLcid() == 1025) // 1023 is Arabic
    alert("تعريف الرقم خطأ");
else
    alert("Invalid number format");


No comments: