Customer field allow the users to select Account/Contact. So, to restrict Customer field in such a way it should allow the users to select only contacts. Add defaultcustomer at onload event of the form.
Filter: use following filter after removing internal double quotes.
"<"filter type='and'">""<"condition attribute='accountid' operator='null' "/>""<"/filter">"
~Good Luck~
function defaultcustomer(){ Xrm.Page.getControl("customerid").addPreSearch(addFilter); } function addFilter() { var customerAccountFilter = "Use following filter here"; Xrm.Page.getControl("customerid").addCustomFilter(customerAccountFilter, "account"); Xrm.Page.getControl("customerid").getAttribute().setLookupTypes(["contact"]); }
Filter: use following filter after removing internal double quotes.
~Good Luck~
No comments:
Post a Comment