Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

Blog

InfoPath Current User (AND Manager) Profile. Lumbergh Remix!

Recently I needed to get the current user and their manager’s Active Directory profile to auto-populate a form.   Itay Shakury wrote a great blog post titled Get the current user without writing code that covers the first need (current user) by reading UserProfileService.asmx. But I needed more.

xsn16

Download sample form – ADManagerDetails.xsn

The strategy was to use 2 data connections and query the 2nd with the manager user ID from the first.   At that point you can map any document text field to be ready only and get the default value from one of these data connections.

image

Action Steps

  1. New InfoPath form in design mode
  2. Add 2 receive data connections to http://sharepoint2007/_vti_bin/UserProfileService.asmx
  3. Name them “UserProfile” and “ManagerProfile
  4. Leave the input parameters empty.  It will default to the current user.
  5. Open form Rules and add steps to “re-query” the ManagerProfile:
    1. Set field’s value:  query subtree of ManagerProfile to “Manager” value from UserProfile data tree
    2. Query data connection ManagerProfile.  With the filter set, it will now return different data.
  6. Enjoy and tell your friends.

Video Walkthrough (05:57)

How to build the sample form (above download) in full step-by-step video.  Only 6 minutes!  Well worth the time. 

Hot

InfoPath Current User (AND Manager) Profile. Lumbergh Remix! from Jeff Jones on Vimeo.

MMC – Monitor SharePoint in Real-Time

The Microsoft Management Console has been around for years, since Windows NT 3.5 I believe, and it is a great tool.   Recently I helped create a custom .MSC file to watch SharePoint’s “heartbeat” in real-time and had a lot of fun with the results so I’ll share them here.

First, the beautiful end product: 

bueno.msc

Scope: Windows Server 2003 + MOSS 2007

How did we do it?

  1. Start Run “mmc.exe”   (this opens Author mode)
  2. Add Snap In (Ctrl+M)
  3. Click “Add” button
  4. Select “ActiveX Control” and click “Add”
  5. Select “System Monitor Control” and click “Next”
  6. Give it a name (i.e.  “Current Web Connections”) and click “Finish”

Feel free to repeat #3 to #6 to add multiple nodes to the tree.   This way you can monitor more than one metric across the farm.  With the left hand tree complete you are now ready.

Customize each node with:

  • Perfmon counters
  • Servers
  • Colors
  • Chart scale

Simply right click in the blank space, choose “Add Counter”, and follow the steps you would just like in Perfmon.exe     I personally like to add the same counter for each server in my farm so that on one chart I can see, for example, all of the CPU usage on all machines.

Once you’re pleased with the look and feel click “File Save As” and give a filename for the .MSC

You can now open multiple instances (windows) and tile them across the screen to have a real-time view of SharePoint’s “heartbeat” across all the web front ends in your farm.   

Why do I need this?

  • Establish a performance baseline (what is normal CPU?  during the work day?  at night during scheduled jobs?)
  • Troubleshoot a broken server (easily see differences)
  • Become more familiar with the impact of a topology design  (slow crawls = 100% CPU?)
  • It looks really cool, trust me!
image

image

image

 

image

image

image

image

Hide the “Powered By InfoPath” logo

In working with InfoPath Forms Services in MOSS 2007 I found that the web based form experience is great.  And I like InfoPath but even I don’t want a logo bumper sticker to stare at all day.

By editing “ifsmain.css” on the SharePoint web front end’s 12 hive you can override the system styling to hide this element.   The IE developer toolbar helped me find the CSS class (ToolbarBranding) to add the “display:none” attribute.  Screen shot below. 

Open-mouthed

 

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATELAYOUTSINCifsmain.css

 

image

 

image

Workflow History – Event Type Numbers Decoded

On a SharePoint site’s hidden Workflow History list you might stumble across some strange numbers.  The Event Type is used to store a numeric value and below I’ve listed what each means in plain English.

These map to Microsoft.SharePoint.Workflow.SPWorkflowHistoryEventType which contains their values in Visual Studio for developers.

Unfortunately MSDN does not list the numeric values for use by power users to create filtered views in the browser.   However, I have them here:

 

Number Event Type
0 None
6 TaskCompleted
5 TaskCreated
9 TaskDeleted
7 TaskModified
8 TaskRolledBack
3 WorkflowCancelled
11 WorkflowComment
2 WorkflowCompleted
4 WorkflowDeleted
10 WorkflowError
1 WorkflowStarted

 

image

 

image

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲