Hi,
I've a JS file which replace existing lookup with custom lookup... Below is the code which is generated through Stunnware and returns results in "Result View" tab on stunnware...
function createLookup() {
debugger;
// Set parameters values needed for the creation of a new lookup view...
var viewId = Xrm.Page.data.entity.getId(); // Using the same GUID, the viewId only has to be unique within each lookup's set of views
var entityName = "account";
var viewDisplayName = "Quote Suppliers";
var viewIsDefault = true;
var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" +
"<entity name='account'>" +
" <attribute name='accountid' />" +
" <attribute name='accountnumber' />" +
" <attribute name='customertypecode' />" +
" <attribute name='name' />" +
" <link-entity name='new_product' from='new_supplier' to='accountid'>" +
" <link-entity name='new_quoteproduct' from='new_product' to='new_productid'>" +
" <filter>" +
" <condition attribute='new_quote' operator='eq' value='{<Quote GUID>}' />" +
" </filter>" +
" </link-entity>" +
" </link-entity>" +
"</entity>" +
"</fetch>";
// Define the appearance of your new lookup view
// No changes required here compared to the above, the lookups should have the same appearance
var layoutXml = "<grid name='resultset' object='1' jump='name' select='1' icon='1' preview='1'>" +
"<row name='result' id='accountid'>" +
"<cell name='name' width='200' />" +
"<cell name='customertypecode' width='150' />" +
"</row>" +
"</grid>";
// Add your new view to the Lookup's set of availabe views and make it the default view
// The supplier field is specified here, we want to add this view to that lookup field
Xrm.Page.getControl("new_supplier").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, viewIsDefault);
}
Whereas I am getting error in CRM 2011 as "The XML passed to the platform is not well-formed XML."... Any suggestions?
Ajai