Tuesday, September 30, 2014

The number of items in this list exceeds the list view threshold, which is 5000 items

List View threshold is 5,000 items if more than 5,000 items  list views are not displayed data
similarly Create Page is not displayed.
 
1.The number of items in this list exceeds the list view threshold, which is 5000 items. Tasks that cause excessive server load (such as those involving all list items) are currently prohibited.
Learn about managing a large list or library and ensuring that items display quickly.


 2.Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer

3<View><Query><Where><And><Eq><FieldRef Name='ContentType' /><Value Type='Text'>Item</Value></Eq><Geq><FieldRef Name='DateComposed' /><Value IncludeTimeValue='TRUE' Type='DateTime'>2014-01-01T02:24:39Z</Value></Geq></And></Where></Query></View>

For Solving these issues we need to do following changes.

1.Change List  threshold limit maximum what we required (i.e more than 5,000 items) using central Admin
2. Delete Unique Permission for the list 
3.Create Indexes columns for the required List. Index column should be Unique number column or Grouping column or Other Columns (Ex EmployeeID ,Year , Created... etc.)
4.if any list have more than 5000 items and it does not have any filter conditions then divide that view into more views based data.(Ex; List Have 7000 items divide  into two views 4500(2000-2010), 2500 items ( 2010-2014)
5.Apply filters on the views.

6.in the new page write filter condition like in screen shot and red condition 3 and past into following SelectCommand
SelectCommand="
 In above CAML query DateComposed is indexed column

7.Run Crawling service

Now almost all views are displayed and new page is displayed .

8.If any view shows  issue no2   then change row limit all items to 500, 200, 100, 50, 10
   where it is displayed  data then stop row limit.

Here All most All issues are solved for me In UAT

When ever we are resorting UAT Site collection BackUP to In Production site

if we got same threshold issue then do following changes

1.we need to recreate indexed columns
2.Run Crawling service

Here All most All issues are solved 



















Saturday, September 6, 2014

Get Item details and bind values to multiple control Using ECMA Script in Sharepoint



Get the Item details using ecma script and bind to multiple controls.

1.  get item id from query string
2.  get item details
3.  get drop down list index and bind to value to this
4.  get multiple radio button list and bind value to this.
5.  get textbox and bind value to this.
6.  get multi choice and add and remove value to this.

       // get the ID value from the URL

        var itemId = GetUrlKeyValue("rId", false, location.href); 

          if (itemId > 0 || itemId!=="")
           {
             GetItem();
           }
          function GetItem()
          {                            
            clientContext= new SP.ClientContext.get_current();
            web = clientContext.get_web();
            list = web.get_lists().getByTitle('RMMChangeProcess');
            listItem = list.getItemById(itemId);         
            clientContext.load(listItem);  
            clientContext.executeQueryAsync(Function.createDelegate(this, onSuccess),      Function.createDelegate(this, onFail));
          }
         function onSuccess() {                                                 
                       
                       // get lookup value from the list
                        var strLocation= listItem.get_item("Location").get_lookupValue(); 
                       
                       //  get dropdown index and bind value that
                        var LocationId= $("select[Title='Location']").attr("id");
                        var LocationControl= document.getElementById(LocationId);                                
                        LocationControl.options[LocationControl.selectedIndex].text=strLocation;
                        
                         // get lookup value from the list
                        var strCategory= listItem.get_item("Category").get_lookupValue(); 
                      
                       //  find radio button list in the div and if option value is find then check that
                        $("#divCategory").find("input[type='radio']").each(function(){                              
                              var Category= $(this).closest('span').attr("title");                            
                               if(Category==strCategory)
                               {                                 
                                  $(this).prop('checked', true);                              
                               }                       
                        });                       
                                                
                        var RawMatcode = listItem.get_item("RawMaterialCode");
                        
                       // get textbox value in the table row and bind value to this
                        var Rmcode= document.getElementById('tr').getElementsByTagName('td') [1].getElementsByTagName('input'); 
                        Rmcode[0].value=RawMatcode ;
                        Rmcode[0].readOnly=true;

                        var supplier= listItem.get_item("PresentSupplier"); 
                        
                         // remove value from multi choice list
                        var arrSuppliers=[];
                        for (var i = 0; i < supplier.length; i++)
                        {
                          arrSuppliers.push(supplier[i].get_lookupId()+";" +  supplier[i].get_lookupValue());
                           // by value
                       $("[id$='_SelectCandidate'] option[value="+ supplier[i].get_lookupId()+"]").remove();
                           // by text                //$("[id$='_SelectCandidate']option:contains("+supplier[i].get_lookupValue()+")").remove();                 
                        }
                       
                       // add the value to multi choice list
                        for(var key in arrSuppliers)
                        {
                          var arrKeyValue=arrSuppliers[key].split(';')
                          // construct option item                        
                          var $resultOptions = "<OPTION title="+ arrKeyValue[1]+" value="+arrKeyValue[0] +">"+arrKeyValue[1]+"</OPTION>";
                      
//var $resultOptions = "<OPTION title=India value=1>India</OPTION>";                        
                          $("[id$='_SelectResult']").append($resultOptions);
                        }                            
        }
        function onFail() {
        
         alert('fail');
       }