Hide Recent Items from Dynamics 365 CRM Lookup form using Xrm.Utility.lookupObjects through JavaScript | CloudFronts

Hide Recent Items from Dynamics 365 CRM Lookup form using Xrm.Utility.lookupObjects through JavaScript

  1. User property disableMru = true;
  2. You can refer below code

      selectProjectLayout: () => {

        var lookupOptions = {};

var _projectLayoutName = null;

var customFilter = ‘<filter type=”and”>’ +

‘<condition attribute=”cf_project” operator=”eq” value=”‘ + Operations.selectedProjectId + ‘”/>’ +

‘</filter>’;

lookupOptions.allowMultiSelect = false;

lookupOptions.defaultEntityType = “cf_tcmaplayout”;

lookupOptions.entityTypes = [“cf_tcmaplayout”];

        lookupOptions.disableMru = true;// used to hide recent items

try {

if (Operations.selectedProjectId !== null) {

lookupOptions.filters = [{ filterXml: customFilter }];

Xrm.Utility.lookupObjects(lookupOptions).then(

function (result) {

if (result !== undefined && result.length > 0) {

// your code

}

}

},

function (error) {

if (error != null) {

Xrm.Utility.alertDialog(error.message);

}

}

);

}

} catch (e) {

Xrm.Utility.alertDialog(e.message);

}

}


Share Story :

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close