On a CRM 2011 form I have a radio button (two options) field called new_yearchecked and a lookup field called new_checkedby from which I can lookup CRM Users.
I want to add a piece of Javascript to the form that if new_yearchecked changes to 'Yes' new_checkedby will automatically populate with the name of the User who changed new_yearchecked.
Can anyone help? This is where I am;
function YearChecked() {
if (Xrm.Page.getAttribute("new_yearchecked") = True) {
var userLookup = Xrm.Page.context.getUserId();
if (userLookup != null) {
Xrm.Page.getAttribute("new_yeacheckedby").setValue(userLookup);
}
}
}