Saturday, December 1, 2012

Lightening Conductor Web Part:for SP2010


Lightening Conductor Web Part:

Requirement:

Recently we came across a small requirement of “Export to Excel” functionality for the SharePoint List/Library view where only Selected columns to be exported into Excel using OOB(out of the Box Solution).

Solution:

Using Lightning Tool Conductor web part, you can easily achieve this and was helpful where we need OOB solutions for joining two lists.

Brief Description about Lightening Tool Conductor Web part:

SharePoint Cross Site Collection Rollup Web Part:




The Lightning Conductor Web Part is a very easy to configure SharePoint List and Library rollup Web Part that can rollup SharePoint Content from across multiple site collections and web applications.
Unlike the Content Query Web Part (CQWP), the Lightning Conductor Web Part can aggregate SharePoint content from anywhere within your SharePoint farm. Instead of writing XSL to display multiple columns of information from SharePoint Lists, you can also configure a view with the Lightning Conductor Web Part without writing any code at all.



Rolling up SharePoint Content is easy with the Lightning Conductor Web Part. Using the Configuration Wizard, you can build your query within minutes to rollup SharePoint Content. You can choose where the content will be aggregated from, and filter by List Type, and Content Type. You can direct relevant content to your users by using the SharePoint Audience Targeting feature.

Once you have configured your Query, you can build your view without writing any XSLT. Simply choose the columns that you wish to display, setup filters, apply formatting, setup pagination and you are ready to display your rolled up content.

Building your view allows you to display multiple columns easily. For example, instead of just displaying the title column from your SharePoint Task Lists, you can display Title, Due Date, Status and Priority.


With the Lightning Conductor Web Part, you can display your results by using the SPGridView easily or you can brand and build in your own features using XSLT, jQuery or Javascript. Within the Lightning Conductor Web Part, you will find pre-built views for displaying Calendar list items within a calendar, and a branded example of rolling up from Announcements lists.

When clicking a list item, you will never be taken away from the page containing the Lightning Conductor Web Part no matter where in the SharePoint farm your content resides. This allows users to use the data as though it belonged to the site that they are currently viewing.

Pros and Cons of Using LCWP:
Pros:
  •         Lightning Conductor Web Part, has an Export to Excel/CSV function, which does not export the item type and path (Default columns), but rather only the columns which are displayed within the web part 
  •           Easy to select and configure anywhere in the site collection. For e.g.: You can add it in sub site to access root site collection list/library.
  •           Multiple Lists/Libraries can be easily combined and configure with the use of Linked Data Sources in SP Designer.
  •           Item link can be given to any column in the List without using SP Designer. 

Cons:
  •          Inner join of lists/libraries cannot be done
  •  ·         Cannot customize the web part using SP Designer. 

For More Information You can contact Technical Support of this 3rd party tool vendor at “Lightning Tools support@lightningtools.com
Link to Lighting Tool Conductor Tools for SharePoint: http://lightningtools.com/

Monday, June 18, 2012

Adding SP Users into SP Group Dynamically

Requirement:
How o Add multiple users into SP2010 Group Dynamically

Solution:
We can achieve it in two ways as below:
1.Using UserGroup.asmx(AddUserToGroup) which is tedious process as below:
Above web service will work only when we pass User Name, User Login Name, User Email and to get these information we need to use Query User profile and need to loop all users.

2.Using UserGroup.asmx(AddUserCollectionToGroup) which is easy as below:

a)Build String - This will concatenate the initial XML, the TestUsers context token and the trailing XML. The result will be stored in the UserList workflow variable. Configure the action using the settings below.
Note: UserList is Nintex Single line text variable

b)Regular Expression - This action will further process the value in the UserList variable by replacing each semicolon with additional XML



c)Call web Service - To add  users into SP Group , configuration follows :




So Its done try and check it out........

Adding User to SP Group Using Nintex Dynamically

Requirement:
Adding user to SharePoint 2010 Group Dynamically Using Nintex


Solution:
Use usergroup.asmx web service as mentioned below:
VarLoginName , VarUser, Varemail are the variables which will hold User properties and can easily get using Query User Profile.

Monday, May 14, 2012

Displaying Notes Link as Hyperlink in SP Field..!


Steps to follow for showing Notes Link in All Items Page of a List:
        
1.     Create a “Single Line of Text” column for notes URL.  e.g. “Notesurl” (Migrate the notesurl field into this text field).
2.     Create a calculated column with the formula –    
 =“<a href=’” & Notesurl & “’>”& Notesurl & “</a>”         
3.     Create a document library to hold attached jquery script file (jquery-1.3.2.min.js). -- Link to Jquery File jquery-1.3.2.min
                                           
4.     In  “Allitems.aspx” page -> Add a CEWP below the list view with the code mentioned code from Notes Link Script.  
Notes Link
Showing Notes Link Display form of an item in list:
          To Show same link in DispForm.aspx – add CEWP (Content Editor Web Part) below list web           part and add the content mentioned as below. 
1.      <script type="text/javascript" src="<Path Of Jquery file>">
2.      </script>
3.      <script type="text/javascript">
4.      fields = init_fields();
5.      // This is an array of FieldInternalNames for all fields to reformat
6.      var arrOfFieldsToReformat = ['LinkCol];
7.      // Loop trough all fields in array and reformat to decent link
8.      $.each(arrOfFieldsToReformat,function(idx,item){
9.         var LinkField = $(fields[item]).find('.ms-formbody');
10.     LinkField.html(LinkField.text());
11.  });
12.  function init_fields(){
13.  var res = {};
14.  $("td.ms-formbody").each(function(){
15.  if($(this).html().indexOf('FieldInternalName="')<0) return;
16.  var start = $(this).html().indexOf('FieldInternalName="')+19;
17.  var stopp = $(this).html().indexOf('FieldType="')-7;
18.  var nm = $(this).html().substring(start,stopp);
19.  res[nm] = this.parentNode;
20.  });
21.  return res;
22.  }</script>
Note: In line 6 you must insert your own FieldInternalNames! You can add multiple FieldInternalNames, comma separated.
This will result in a DispForm like this:
Notes Link In Display form

Copying Docs from One Library to another Library in SharePoint Using Nintex

Requirement:

  1. User will Send mail from outlook to document library where mails has been configured 
  2. Current User Folder has to be created and mail sent has to be stored inside the folder.
Solution:
  1. Create a Document Library where mail is configured.
  2. Write a Nintex Workflow as shown below.
    • Creates a Current User Folder in Document Library
    • Copies the mail sent to folder

Create Item Action Configuration:


Copy to SharePoint Action Configuration:


Finally Files Uploaded/Sent to One Document Library will be copied to Destination Library.

Saturday, May 12, 2012

How to display custom pages for different content types in SP list

I got requirement like ,when creating content types in list , custom design pages for every content type has to be displayed for the items in list.
               Recently in my migration from lotus notes to SharePoint 2010 , client need this type of requirement .So after browsing long time i got a link saying how to create it.
     Here is the link, we achieved the above requirement.  
     http://sprider.org/2012/03/06/sharepoint-custom-list-with-custom-display-forms-for-each-content-types/ 
     I  created custom pages and assigned to each content type in list for display form as mentioned in above link.It was success and working as expected.
                   After few days we faced new issue on following above approach i.e., in search functionality of SharePoint , custom pages designed were not appearing showing only default display form of the list.
So with the client object model of SP2010 fixed this issue as below.
  1. Create the custom pages for all content types 
  2. Do not assign to each content type as shown in above link
  3. Open the default display form of list and insert following  code as below
/* Getting query string for item id*/
     JSRequest.EnsureSetup(); 
     var itemId = JSRequest.QueryString["ID"];
/* Client object model code for retrieving item properties*/
      ExecuteOrDelayUntilScriptLoaded(GetItems, "sp.js");               
       var context;   
       var web = null;   
       var collListItem;
       var Initialvalue = 1;
       var docItem;
     function GetItems()
    {
    try
    {
    context = new SP.ClientContext.get_current();
    web = context.get_web();
    var lists = web.get_lists();
    var doclogList = lists.getByTitle("listname");
    docItem = doclogList.getItemById(itemId);
    context.load(docItem,'Title', 'ContentTypeId');
   context.executeQueryAsync(Function.createDelegate(this, this.itemReceived), Function.createDelegate(this, this.failed));
   }
   catch(e)
   {
   alert(e);
   }
}
/*  Content type ids for each content type in SP list - you can get id from your site after creating content types.
Frmdebookv2=0x0100863B8B29335BAF4481A5CA2ACCED155E008C0AEC34BA9F1447913B0E28247BD0BA

Mainv2 =0x0100B5DA9AD10641494AA721F44CCF89A928003A57D431589C80428EBB37AA055E9CF3

fmDebook= 0x010400A729D5FD3202854C882E8D8CBBB6FA5700997CCC7B718AC442B1112497F41FD08

Main =0x010400E39B41873A1F7840B1FE133CE431E56C00DA02B82C4CC08444A1E64B47676551F4 */

/* Function to redirect to respective custom based on the content types */
function itemReceived() 
{  
    var cTitle=docItem.get_item('ContentTypeId');
    var itemIdval = JSRequest.QueryString["ID"];

 if(cTitle=='0x0100B5DA9AD10641494AA721F44CCF89A928003A57D431589C80428EBB37AA055E9CF3')
    {
/* Redirect to Custom content type page designed for Mainv2 content type */
    window.location.href='/sites/booklist/Lists/Checklist%20Database/AGSMainv2Dispform.aspx?ID='+itemIdval;
    }
else if(cTitle=='0x010400E39B41873A1F7840B1FE133CE431E56C00DA02B82C4CC08444A1E64B47676551F4')
    {
/* Redirect to Custom content type page designed for Main content type */                   window.location.href='/sites/booklist/Lists/Checklist%20Database/DispForm.aspx?ID='+itemIdval;
    }    
else if(cTitle=='0x0100863B8B29335BAF4481A5CA2ACCED155E008C0AEC34BA9F1447913B0E28247BD0BA')
    {
/* Redirect to Custom content type page designed for FrmDebookv2 content type */ 
    window.location.href='/sites/booklist/Lists/Checklist%20Database/AGSFrmDebookV2AGSDispform.aspx?ID='+itemIdval;
    }
elseif(cTitle=='0x010400A729D5FD3202854C882E8D8CBBB6FA5700997CCC7B718AC442B1112497F41FD08')     {
/* Redirect to Custom content type page designed for FrmDebook content type */ 
    window.location.href='/sites/booklist/Lists/Checklist%20Database/AGSfmDebookDispform.aspx?ID='+itemIdval;
    }    
}
function failed(sender, args) {
    alert('failed. Message:' + args.get_message());