Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Thursday, May 4, 2017

SharePoint 2010/2013: Workflow Invoking on an Email Enabled List

Scenario:
You have an emailed enabled list in SharePoint. You also have a workflow created against the list that is configured to run on both the creation and update of list items. When someone sends an email to the list, you want the workflow to run. You either want to include or exclude the original email.

Default Behavior and Settings
When enabling Incoming Email on a list, the default setting is to include the original email.



If you have a workflow associated with this list with this setting as Yes, that workflow will invoke when a user emails into the list. My particular workflow needed to send all attachments from the email to a particular Exchange mailbox.

My Result
My workflow worked fine. When an email was sent to the list with attachments, my workflow was able to send those attachments to the Exchange mailbox. Included was the original email as an .eml file.

Not Including the Original Email
However, in my scenario, I needed to keep the email anonymous. Therefore, I did not want to include the original email as that would display the original sender. So I switched the Incoming Email setting to No.



Workflow Behavior Without Original Email
Once I did not include the original email, the workflow associated no longer invoked when a user sent an email to the list. Bummer.

Solution
As my director always says, "There's gotta be a setting for that". This is not always the case but in this case I got lucky.

There is a setting that will invoke workflows when a user emails into this list without saving the original email. It is crazy that this setting (and you'll see the name soon) actually exists.

There is a SharePoint Administration setting within the content service that allows declarative workflows (SharePoint Designer) to invoke on email enabled lists. The setting is named DeclarativeWorkflowStartOnEmailEnabled.

No way! Really? This is what I needed. Back in the day this setting was set using stsadm. Nowadays, a few PowerShell statements and you are set (pun intended).



$spWebService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$spWebService.DeclarativeWorkflowAutoStartOnEmailEnabled= $true
$spWebService.Update()


Yeah baby!

Result
As a result in my scenario, the workflow is now invoked when a user emails into the list without saving the original email. The sending of attachments to the Exchange mailbox no longer includes the original email (.eml) file.




Kudos
Special thanks to my wonderful co-worker Liz Lowry for remembering there was an email setting to not include the original email.


Wednesday, December 10, 2014

SharePoint 2013 Search: Error Launching Query Builder - RESOLVED

Problem
When attempting to launch the query builder when creating a new Content Source or Result Source via Central Admin you receive an error as follows:

Error: Not able to connect to search service to retrieve valid settings.


Solution
You need administrator rights to the Search Service Application - even if you are a farm administrator. (I just recently encountered this issue but thought it worked before - I am thinking that recent patches and updates plugged a security hole).

Solution Implementation - PowerShell
You can solve this easily by running the following PowerShell script with your account name:

$principal = New-SPClaimsPrincipal "DOMAIN\USERNAME" -IdentityType WindowsSamAccountName

$spapp = Get-SPEnterpriseSearchServiceApplication

$security = Get-SPServiceApplicationSecurity $spapp –Admin

Grant-SPObjectSecurity $security $principal "Full Control"

Set-SPServiceApplicationSecurity $spapp $security –Admin 

Solution Implementation - Central Admin
You may also solve this via Central Admin.

From Application Management, click on the Manage service applications link under the Service Applications section:


Scroll down to your Search Service Application and select it:


On the SERVICE APPLICATIONS top ribbon, click the Administrators button:


In the Administrators dialog, enter the account that needs permissions and click the Add button:

Select the account in the list and grant Full Control:


Click OK.

The Query Builder dialog will now launch properly without any trouble.






Friday, November 14, 2014

SharePoint 2013: Hiding the Blog Tools Web Part

Problem
You want users to have contribute rights to your blog site but do not wish to show the Blog Tools on the post pages. If you remove the web part, other blog web parts (e.g. Categories) do not work. If you modify the Blog Tools web part properties and select the Hidden property, the web part still renders.

Viewing the web part properties in the page (via SharePoint Designer) shows that the web part should not be visible and should be hidden:
BUT IT STILL DISPLAYS ON THE PAGE!

Solution
Modify the Blog Tools web part properties as follows:


  1. Change the Height to a fixed height of 0 pixels
  2. Change the Chrome State to Minimized
  3. Change the Chrome Type to None




Click OK and Save (or Stop Editing) the page.

Refresh and the Blog Tools web part is still on the page but does not show!

SharePoint 2013: Blog Category Links Not Working

Problem
Within a blog site while viewing posts, the list of category links do not filter the posts.


When viewing the source of the page, you notice that the anchor hyperlink references (href) are blank:


Solution
Add the Blog Tools web part back onto the page. The Categories web part does not seem to work properly if the Blog Tools web part is removed.



SharePoint 2013: Metadata Navigation Settings Option Missing from Document Library



Problem
You navigate to a document library's document settings and do not see the Metadata navigation settings link:

Solution
In order to configure the metadata navigation settings on a document library within a site, the Metadata Navigation and Filtering site feature must be activated.

Select Site Settings from the settings (gear) menu. Select Manage Site Features under Site Actions. Find the Metadata Navigation and Filtering feature and click the Activate button:


Result
The Metdadata navigation settings link is now available within the Document Settings of the document library:





Monday, January 20, 2014

SharePoint 2013: Installing and Configuring Project Server 2013


Check out the whole SharePoint 2013 Solution Series

Installing and configuring Project Server 2013 in a SharePoint 2013 environment is fairly easy but does require various installation and configuration steps:

  1. (Optional) Build out  a new Application Server and add it to your SharePoint farm.
  2. Install Project Server 2013 on the Application Server - DO NOT RUN THE CONFIGURATION WIZARD!
  3. Install Project Server 2013 on all other non-database servers in the farm.
  4. Run the SharePoint Products Configuration Wizard on all non-database servers in the farm.
  5. Create the Project Server 2013 Service Application and start the Project Server 2013 service.
  6. Create and configure the Project Web App instance
  7. Connect Microsoft Project 2013 to the Project Web App
  8. Publish a Project file (.mpp) to SharePoint


Get all of the exact steps, details, and screenshots in my SharePoint 2013 Solution Series guide:

Wednesday, August 1, 2012

Creating Pop-Out Menus in SharePoint using jQuery/jQueryUI and CSS

Background
On our SharePoint based intranet home page, we have custom web parts along the right hand side of the screen. These web parts display various sets of links - creating a right hand navigation menu system. Two of these web parts displayed links from a SharePoint list behind the scenes. So the content was somewhat dynamic and could easily be maintained by adding or modifying list items; easy.
Problem
With so much functionality on the home page resulting in tons of web parts, we needed ways to slim down the processing. While we tweaked the list item access and various other things, these menu lists still needed to be lighter - like static HTML. In addition, since these links are used on an as-needed basis, they really don't need to be shown all of the time let alone cost any time to render.
 

Proposed Solution
The proposed solution was to combine the two sets of lists into one pop-out menu which would be lightweight.

Technical Solution
We wanted a section of the right hand navigation menus to show the heading but when hovered over (via the mouse), would pop-out and display two columns of lists. The HTML markup was easy but what about the hovering?

Enter CSS. We originally used various CSS classes and styles to control the size and display of the menu including the use of the :hover style. This worked great but there was no delay and as such, any mouse over would pop the menu up regardless if the user was intending to go to the new menu. So we needed a way to change the styles but use a delay.

Enter jQuery and jQueryUI. Through the use of jQuery as well as the jQuery UI Hover functionality, we were able to delay the pop-out as well as cancel the potential pop-out if the user happened to mouse over the menu to get somewhere else.


Result (sanitized versions)

Menu initial appearance:


Menu pop-out on hover:


Hint: See live demo in action at the bottom of this post!


Menu Markup
The menu HTML consists of one overall <div> (in our example named OnlineServices). Within that <div> is our main container (named OS-container) whose style changes based on the hovering. Within the container is a title div and a tip div. The title div is the initial state while the tip div is the pop-out menu markup.

Below is a shortened version of the markup:

<div id="OnlineServices">
 <div id="OS-container" class="OS-container-collapsed">
  <div class="OS-title">Online Services and Company Links</div>
  <div class="OS-tip">
   <div class="OS-tip-col">
    <strong class="OS-tip-col-title">Online Services</strong>
    <ul>
     <li>
     <a href="http://stevethemanmann.com" onfocus="OnLink(this)">
     Audio Conference Reservation</a></li>
    </ul>
   </div>
   <div class="OS-tip-col">
    <strong class="OS-tip-col-title">Company  Links</strong>
    <ul>
     <li>
     <a href="http://stevethemanmann.com" onfocus="OnLink(this)">
     Client Visit Feedback Form</a></li>
    </ul>
   </div>
  </div>
 </div>
</div>

CSS Styles
The main CSS styles are shown below. The important classes to note are the OS-container-collapsed and the OS-container-expanded. We also included a :hover for the collapsed to make the initial menu appear active (but this hover has nothing to do with the pop-out functionality).

#OnlineServices{position:relative; display:block; height:40px;margin:6px 0; z-index:100}
.OS-container-collapsed{height:38px; width:298px; overflow:hidden;  position: absolute; top:0; right:0; display: block; border: 1px #ccc solid;background-color:#eee; background-image:url(/_layouts/images/MNetImages/icon-expandmenu.png); background-position:255px 0px; background-repeat:no-repeat;}
.OS-container-collapsed:hover{background-color:#f8f8f8;}
.OS-container-expanded{ height:auto; width:620px; overflow:visible; position:absolute;  top:0; right:0; display: block; border: 1px #ccc solid;background-color:#eee; background-image:none; -moz-box-shadow: 0px 1px 2px #999;-webkit-box-shadow: 0px 1px 2px #999;box-shadow: 0px 1px 2px #999; float:right; }


jQuery
The key to the delayed popping out and not responding if the user just happened to graise the menu was in the jQuery:

 $(document).ready(function(){
     var timer;
        $('#OS-container').hover(
            function(){
             if(timer) {                        
               clearTimeout(timer);
               timer = null
               }
                timer = setTimeout(function(){
                    $('#OS-container').removeClass('OS-container-collapsed');
                    $('#OS-container').addClass('OS-container-expanded');
                }, 500);
            },
            function(){
             if(timer) {                        
               clearTimeout(timer);
               timer = null
               }
                $('#OS-container').removeClass('OS-container-expanded');
                $('#OS-container').addClass('OS-container-collapsed');
            });
    });

Essentially, on the hover, the CSS classes are swapped to perform an expand or collapse of the menu (creating the pop-out effect) but only if the mouse is hovering for more than 1/2 second (500ms).



LIVE DEMO: (hover over the Online Services and Company Links box)
















View the source of this post and check out the full jQuery code, styles, and markup! Look for "Online Services Menu".

Wednesday, March 7, 2012

Reducing the Network Footprint and Page Response of Telerik Controls in SharePoint

As part of an overhaul of our current SharePoint 2007 environment, we decided to implement some enhanced functionality. We used the Telerik Rad Controls to assist in providing rich interfaces without having to code everything custom. Our home page would contain at least 12 web parts that all utilized one or more Telerik controls including RadRotator, RadGrid, RadPanel, and RadTooltip along with RadAjaxManagers and Loading Panels.

This was all good. We had everything working, implemented some asynchronous calls and AJAX postbacks, etc. It was pretty quick in IE 9. However, since most user machines were still running IE 7 with Windows XP, the performance wasn't as great. The initial page load of the home page was horrible and this was in the same city as the servers - imagine the response on the West Coast, U.K., China, etc. So obviously we did a ton of digging and various optimizations with the code and environment.

One of the simplest things which we didn't actually do until almost last, was to reduce the amount of calls between the client and server machines. Initially we blamed Telerik for producing a large overhead on the page when there are many different controls implemented. Looking at the trace showed many WebResource and ScriptResource calls:


(click on image to see larger view)

At the point of the above trace, all the calls were less than 1ms (I have seen them higher) but there seemed to be a lot of chatter here. What are all those ScriptResources anyway? These are the loading of javascript that is embedded in the Microsoft and Telerik assemblies.

I found a great way to combine the Script Resources into one call. This involves knowing exactly what is being called from your page. Luckily there is a Script Reference Profiler assembly which produces exactly what you need. This assembly is available on CodePlex and there is some documentation on how to use it on DotNetCurry.com.

Essentially the result is adding the used script resource references into your ScriptManager instance using the CompositeScript and Scripts tags. Since we were working in SharePoint, I added this to the master page:


This instantly combined all of the ScriptResource calls:




(click on images to enlarge)

Ok. This was good. But now what's up with those WebResource.axd calls? In the trace above they are taking longer than before. Reviewing the Response Body details of the WebResource.axd calls revealed that these were embedded CSS styles within the Telerik assemblies:






As it turns out, Telerik has a way to combine all of their CSS WebResource.axd calls into one! Again, in our master page, right under the ScriptManager, I added the RadStyleSheetManager:



I thought I was going to need to know which embedded stylesheets are being used, but since we are only using Telerik assemblies, the RadStyleSheetManager auto-magically handles them. Just by adding that one line combined all of the Telerik WebResource.asd calls into one call:




So now I have reduced the initial 20 calls into 3 combined calls - reducing network traffic, page response time, and overall rendering of the home page!


If you found this useful, please help support my SharePoint and .NET user group (Philly SNUG) by clicking on the logo below.

Wednesday, October 12, 2011

Adding Klout to SharePoint: Klout Web Part


My vision for a Klout web part was to have a control that served two purposes. The first purpose would be to allow users to enter their Klout account (if one wasn't entered already) which would then get stored in their profile. The second would be to actually display the Klout Score in the web part if the account was previously entered.

The steps to performing this are as follows:




  1. Create a Visual Web Part that loads an .ascx control
  2. Create a control that has at least a text box and button for the user to enter their Klout account.
  3. Have the button update the SharePoint User Profile with the Klout account (see previous post for info on the custom property)
  4. Have the web part render the Klout Widget image if the user's profile contained a Klout account.

I have a step-by-step walkthrough of these tasks in my guide here.
The steps in the guide are based on SharePoint 2010, however, it is a similiar process for SharePoint 2007 and SharePoint Online (via Office 365).

There are also instructions contained in the guide on how you may access and download code that assists in integrating Klout with SharePoint.



If you found this useful, please help support my SharePoint and .NET user group (Philly SNUG) by clicking on the logo below.

Monday, October 10, 2011

Adding Klout to SharePoint: Search



When I thought of integrating Klout scores into SharePoint, the first thing I thought of was the People search results. This made sense since when searching for people in an organization, you would easily be able to see their Klout score with their information.

The steps to performing this are as follows:



  1. Add a custom property to the User Profile Service.
  2. Crawl People to generate a new crawled property based on the new user profile property.
  3. Create a Managed Property for search that maps to the crawled property.
  4. Modify the People Search Core Results XSLT to display the Klout Widget incorporating the new search managed property.

I have a step-by-step walkthrough of these tasks in my guide here.
The steps in the guide are based on SharePoint 2010, however, it is a similiar process for SharePoint 2007 and SharePoint Online (via Office 365).

There are also instructions contained in the guide on how you may access and download code that assists in integrating Klout with SharePoint.



If you found this useful, please help support my SharePoint and .NET user group (Philly SNUG) by clicking on the logo below.

Matched Content