14. September 2012 15:19
15. September 2012 10:13
17. September 2012 14:22
17. September 2012 14:27
17. September 2012 14:34
17. September 2012 14:43
var field = crmForm.all.primarycontactid; //zu filterndes Lookup-Feld
var objToFetch = crmForm.ObjectId; //einschraenkendes Parent-Feld
var entityForList = "contact"; //zu filternde Entität
var attribForFilter = "parentcustomerid"; //Filter-Attribut der zu filternden Entität
if (objToFetch == null) {
// Disable lookup for new account record as there can be no contacts
field.Disabled = true;
}
else {
// Ensure that search box is not visible in a lookup dialog
field.Disabled = false;
field.lookupbrowse = 1;
// Pass fetch xml through search value parameter
field.AddParam("search",
"<fetch mapping='logical'><entity name='" + entityForList + "'>"
+ "<filter><condition attribute='" + attribForFilter + "' operator='eq' value='"
+ objToFetch
+ "' /></filter></entity></fetch>");
}