HI,
I have written a Javascript for Lookup field on contact entity to enable or disable the field.
Please find the below code for the same.
var CRM_FORM_TYPE_CREATE = 1;
var CRM_FORM_TYPE_UPDATE = 2;
if (Xrm.Page.ui.getFormType() == CRM_FORM_TYPE_CREATE || Xrm.Page.ui.getFormType() == CRM_FORM_TYPE_UPDATE) {
if ((CurrentUser.HasRole("Sales Manager")) || (CurrentUser.HasRole("System Administrator"))) {
var TestUSer = Xrm.Page.ui.controls.get("new_testuserlist");
TestUSer.setDisabled(false);
TestUSer.setRequiredLevel("required");
}
else {
TestUSer.setDisabled(true);
TestUSer.setRequiredLevel("none");
}
}
Above code is working fine in Adminstration role.
But when I'm assigning the Sales Manager Role to User1 I'm unable to open the lookup value
As I'm unable to open the lookup field with the User1.
"You don't have a sufficient privileges to open this lookup Dialog box.
In lookup field form changes I enabled the Only Show records where check-box .
Insdie that CreatedBy(Delegate)(Child Entity)
CreatedBy(Delegate)(Parent Entity)
Thanks,
Thanks, Toushu