365 CRM
function defaultcustomer_onLoad(executionContext){
var formContext=executionContext.getFormContext()
var control = formContext.getControl("parentcustomerid");
control.setEntityTypes(["contact"]);//Contact or account
}
2016/365:
var control = Xrm.Page.getControl("from");
control.getAttribute().setLookupTypes(["contact"]);
2013/2015:
function CustomerLookupOnlyContact() {
var customerCtrl = Xrm.Page.getControl("customerid");
customerCtrl.setFocus();
var customerInput = document.getElementById("customerid_i");
customerInput.setAttribute("lookuptypes", "2"); //2: Contact , 1: Account
customerInput.setAttribute("defaulttype", 2); // Set defaultType to Contact
//customerInput.setAttribute("autoresolve", 2); // Partially entered name will be resolved with contact record.
//customerInput.setAttribute("createpermissiondictionary", "account:false,contact:true");
// customerInput.setAttribute("lookuptypenames", "contact:2:Contact");
// customerInput.setAttribute("DefaultViewId", "{A2D479C5-53E3-4C69-ADDD-802327E67A0D}");
}
var control = Xrm.Page.getControl("from");
control.getAttribute().setLookupTypes(["contact"]);
2013/2015:
function CustomerLookupOnlyContact() {
var customerCtrl = Xrm.Page.getControl("customerid");
customerCtrl.setFocus();
var customerInput = document.getElementById("customerid_i");
customerInput.setAttribute("lookuptypes", "2"); //2: Contact , 1: Account
customerInput.setAttribute("defaulttype", 2); // Set defaultType to Contact
//customerInput.setAttribute("autoresolve", 2); // Partially entered name will be resolved with contact record.
//customerInput.setAttribute("createpermissiondictionary", "account:false,contact:true");
// customerInput.setAttribute("lookuptypenames", "contact:2:Contact");
// customerInput.setAttribute("DefaultViewId", "{A2D479C5-53E3-4C69-ADDD-802327E67A0D}");
}
No comments:
Post a Comment