How to disable view picker in filtered view CRM 2011 Javascript
5:16 AMHow to disable view picker in filtered view CRM 2011 Javascript |
Step 1
create your own filter view
function filter_view() { var viewid = "{a76b2c46-c28e-4e5e-9ddf-951b71202c77}";//random var entityname = "new_entityname"; var displayname = "Filter view"; var fetchxml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" + "<entity name='new_entityname'>" + "<attribute name='new_name' />" + "<filter type='and'>" + "<condition attribute='statecode' operator='eq' value='0' />" + "</filter>" + "</entity>" + "</fetch>"; var layoutxml = "<grid name='resultset' " + "object='1' " + "jump='name' " + "select='1' " + "icon='0' " + "preview='0'>" + "<row name='result' " + "id='new_entitynameid'>" + "<cell name='new_name' " + "width='200' />" + "</row>" + "</grid>"; Xrm.Page.getControl("new_fieldname").addCustomView(viewid, entityname, displayname, fetchxml, layoutxml, true);
Step 2
just add a little bit code to disable view picker in the and of function
document.getElementById("xrm_segmentlevel2").setAttribute("disableViewPicker", "1");
Step 3
Done, and finish
thanks for visiting and enjong coding :)
0 comments