27. August 2013 11:27
function setFilteredView() {
var viewId = "{a76b2c46-c28e-4e5e-9ddf-951b71202c9d}";
var entityName = "contact";
var customerId = Xrm.Page.getAttribute("new_kunde").getValue();
if (customerId != undefined && customerId != null) {
var qryContacts = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
"<entity name='contact'>" +
"<attribute name='fullname' />"+
"<attribute name='emailaddress1' />"+
"<attribute name='parentcustomerid' />"+
"<attribute name='telephone1' />"+
"<filter type='and'>"+
"<condition attribute='parentcustomerid' operator='eq' value='" + customerId[0].id + "' />"+
"</filter>"+
"</entity>"+
"</fetch>";
var layoutXml = "<grid name='resultset' object='1' jump='name' select='1' icon='1' preview='1'>" +
"<row name='result' id='contactid'>" +
"<cell name='fullname' width='100' />" +
"<cell name='emailaddress1' width='100' />" +
"<cell name='parentcustomerid' width='100' />" +
"<cell name='telephone1' width='100' />" +
"</row>" +
"</grid>";
var viewDisplayName = "Zugeordnete Kontakte / assigned contacts";
Xrm.Page.getControl("new_kontakt").addCustomView(viewId, entityName, viewDisplayName, qryContacts, layoutXml, true);
}
}
27. August 2013 15:21
27. August 2013 15:40