I am attempting to customize a lookup dialog to default to a specific entity type.
While working on the Connection form, I am checking the entity type of record1id and attempting to use that information to set the defaulttype attribute on record2id.
My current approach involves:
document.getElementById("record2id").setAttribute("lookuptypenames","incident:112:Case");
document.getElementById("record2id").setAttribute("lookuptypes","112");
document.getElementById("record2id").setAttribute("defaulttype","112"); // Case
Xrm.Page.getControl("record2id").setDefaultView("{9AC51863-58C7-49A0-ADCC-AFD9A4C3EE59}");
The code above successfully limits the lookup dialog type selection to only incident (although not exactly what I intended), but I am having trouble changing the default view to something else as desired.
I am currently stuck and open to new ideas or suggestions on how to achieve this customization effectively.
Thank you