Hi,
Looking for the solution to autofill lookup with value (If it has only one result) . I am expecting only one result in lookup in some cases and so would like to show that result as default instead of expecting it to be selected by end users.
I have tried below code but it is not working as expected
var lookup = new Array();
lookup = Xrm.Page.getAttribute("new_account_lookup").getValue();
if (lookup != null) {
Xrm.Page.getAttribute("new_account_lookup").setValue([{ id: lookup[0].id, name: lookup[0].name, entityType: lookup[0].entityType}]);
}
Thank you,
Raj