Hi,
i created a custom entity Employee which is having lookup with account so i want to show list of employee mapped with current account in employee lookup which is there in account form when clicking on lookup icons i tried with this code but want to get current id and needs to add in fetchxml don't know how to do that and its not working.
function preFilterLookup() {
Xrm.Page.getControl("new_employeeaccountid").addPreSearch(function () {
addLookupFilter();
});
}
function addLookupFilter() {
var getcurrentid=xrm.page.data.entity.getId();
var fetchXml = '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="new_employee"><attribute name="new_employeeid" /><attribute name="new_name" /><attribute name="createdon" /><order attribute="new_name" descending="false" /><filter type="and"><condition attribute="new_accounteid" operator="eq" uiname="A Datum Corporation" uitype="account" value="{A16B3F4B-1BE7-E611-8101-E0071B6AF231}" /></filter></entity></fetch>';
Xrm.Page.getControl("new_employeeaccountid").addCustomFilter(fetchXml);
}
*This post is locked for comments
I have the same question (0)