Posts

Showing posts from April, 2012

Move/Migrate SharePoint List Attachments to Document Library with Created and Modified Date

SharePoint list in which we have items and it has attachments, but SharePoint Search could not look inside Documents which are stored as Attachments in List. So to make it work we have to move all attachments inside the document library so SharePoint Search can crawl and return the results So to provide Keyword Search we need to Move the SharePoint Attachments to Document Library so that we can search in SharePoint Search. Here is code which will move SharePoint List Attachments to Document Library. SPSecurity.RunWithElevatedPrivileges(delegate()            {                using (SPSite site = new SPSite("SiteURL"))                {                    SPList docDestination = site.RootWeb.Lists["DocName"];                    SPFolder fldRoot = site.RootWeb.Folders[docDestination.Title];                    SPFileCollection flColl = null;                    SPList lstAttachment = site.RootWeb.Lists["ListName"];                    foreach (SPListItem ls

http://dishasharepointworld.blogspot.com/

Event on Save button click using JQuery in SharePoint Form(New/EditForm.aspx)

Validation on dropdown value in New/EditForm.aspx before submit the Form using JQuery <script language= "javascript" type= "text/javascript" src= "../../jQuery%20Libraries/jquery-1.4.2.min.js" ></script> <script type="text/javascript"> function PreSaveAction() {  if(($("select[title$='Status']").val()=='Select') && ($("select[title$='Status']").is(':visible')))  {   alert("Required field: "+ $("select[title$='Status']").attr('title'));   return false;  } return true; } </script> Here PreSaveAction() is the build in function so we need to add our custom code in this function.

Using jQuery to Prefill and Disable Required Columns in a SharePoint Form

<script language= "javascript" type= "text/javascript" src= "../../jQuery%20Libraries/jquery-1.4.2.min.js" ></script> 2 <script language= "javascript" type= "text/javascript" > 3    $(document).ready( function () { 4      $( "input[Title='Title']" ).val( "Hello World" ); 5      $( "input[Title='Title']" ).attr( "disabled" , "disabled" ); 6    }); 7     8    function PreSaveAction() { 9      $( "input[Title='Title']" ).attr( "disabled" , "" ); 10      return true ; 11    } 12 </script>     ********************************************************************   if you need to know if a specific object is visible: if ( $('#myitem').is(':visible')){ // perform logic if the item is visible.. } *******************************

Change Width of the Column SharePoint List using JQuery

Change a column  width  using jQuery: View Source to see the name of the table that contains your target column's name. In this case my  list  has a "Category" column. The table that holds the column header that I want to alter looks like the following: <table style="width: 100%;" sortable="" sortdisable="" filterdisable="" filterable="" name="Category" ctxnum="1" displayname="Category" fieldtype="Lookup" resulttype="" sortfields="SortField=Category&SortDir=Asc&View=%7b864B3C2A%2dDF2B%2d4D2\ 9%2d9B31%2d9B5191754A80%7d" height="100%" cellspacing="1" cellpadding="0" class="ms-unselectedtitle" onmouseover="OnMouseOverFilter(this)"> See the name property? It's "Category" If I created a  column  called "Category Column" instead of "Category" it would sho

Clearing the SharePoint Designer 2010 workflow assembly cache

To clear the SPD activity cache on Windows7:    C:\Users\\AppData\Local\Microsoft\WebsiteCache and delete all items in the folder