Applying for fetching record from lookup to grid
function onformLoad(executioncontext)
{
debugger;
var formContext=executioncontext.getFormContext();
var preventivemaintenancekms= Xrm.Page.getAttribute("new_preventivemaintenancekms").getValue();
var str= preventivemaintenancekms[0].id;
//var str= formContext.data.entity.getId();
var id = str.replace("{", "").replace("}", "");
var subgridLookup = formContext.getControl("PMTask");
var fetchXml = "<filter type='and'>" +
"<condition attribute='new_preventivemaintentacetaskid' operator='in'><value>"+id +"</value></condition>" +
"</filter>";
subgridLookup.setFilterXml(fetchXml);
subgridLookup.refresh();
}
but its fetching the id but not the record