Hello guys,
So for this week i'm already faced with a new challenge and as always im hoping you can point me in the right direction.
At the moment i need to retrieve the id of the entity from which im opening a quick create form of another custom entity i need this so i can use in my fetch xml in order to be able to provide related records to a lookup field. Bellow is the sample of the code i have at the moment which is giving me the Invalid Child Node exception.
Xrm.Page.getControl("new_hjemmelshaver").addPreSearch(function () {
debugger;
var parentEntity = window.parent.frames[0].Xrm.Page.data.entity.getId();
var fetchRes = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
"<entity name='new_owner'>" +
"<attribute name='new_ownerid'/>" +
"<attribute name='new_name'/>" +
"<attribute name='createdon'/>" +
"<order attribute='new_name' descending='false'/>" +
"<filter type='and'>" +
"<condition attribute='new_realestateid' operator='eq' value='" + parentEntity +"'/>" +
"</filter>" +
"</entity>" +
"</fetch>";
Xrm.Page.getControl("new_hjemmelshaver").addCustomFilter(fetchRes);
*This post is locked for comments