Posts

Showing posts from 2011

InfoPath - Get the current user

Image
I've just readIP team blog postabout getting the current user's details using Web Services. Actually the exact same result can be achieved without writing any code. It's a very common thing to do and I couldn't find any guide for that, so here it is:
* If you are already familiar with this, this post might still be useful. I have included the complete set of default properties get returned and their proper naming syntax at the bottom.
* This works at InfoPath as well as InfoPath Forms Services.
*Clayton Cobb has a great follow up post if you to take the this a step further. With InfoPath opened go to Tools > Data Connections, and click 'add...' to add a new data connection to the form. This opens up the Data Connection Wizard.We want to receive data from the WS about the current user, so choose receive data' and click next.Our data source is a WS so choose 'Web Service' and next.Now you will have to point the wizard to the WS. Type an address similar…

Site Themes in SharePoint 2010

Image
In SharePoint Server 2010 (SharePoint Foundation 2010 doesn’t support this option) we have a very nice feature to create our own site theme very quickly using the “Site theme” settings page.
But we have a little problem with these settings: we can change the “Text/Background – Dark 1″ or “Accent 5″ but we don’t really know what “Accent 5″ is… So I want to start there a post with mapping of settings in the Site theme settings page. I will start with the basic settings of backgrounds and most useful fonts and I will be glad if you will leave comments with mappings that I missed. General Settings:
Text/Background – Dark 1 – Quick launch links and site text font color. Text/Background – Light 1 – Site Actions Font color + Page background Text/Background – Dark 2 – Top row background (row with Site Actions and other links), Quick Launch headers, Bread crumb links, sub-window title, headers font color in the Content editor Markup styles. Text/Background – Light 2 – Logo’s row and Quick Launch co…

Share point Validation

Image
The Microsoft.SharePoint.WebControls namespace of the  Microsoft.SharePoint.dll contains a number of validation controls that can be used on application pages and web parts to validate user entry in the SharePoint controls. The different validation controls are: InputFormRequiredFieldValidatorInputFormRangeValidatorInputFormCompareValidatorInputFormRegularExpressionValidatorInputFormCheckBoxListValidatorInputFormCustomValidatorIf you want to use these SharePoint control validators, you have to add a page directive to the page: <%@ Register TagPrefix="spuc" Namespace="Microsoft.SharePoint.WebControls"              Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>The following sections describe the use of the different SharePoint validation controls.
The InputFormRequiredFieldValidator controlThis control inherits from the standard ASP.NET RequiredFieldValidator and has the same functionality. Propertie…

Using the SharePoint 2010 Modal Dialog

Image
SharePoint 2010 introduces the new dialog framework which helps users stay in context of the page without navigating away from the page. Yes, the modal dialogs that pop up:

The JavaScript client object model provides the SP.UI.ModalDialog class to work with the dialog framework.
In order to work with the dialog framework, we need to first create the dialog options:
var options = SP.UI.$create_DialogOptions(); options.width = 500; options.height = 250; options.url = "/_layouts/StandardsPortal/ChangePassword.aspx"; options.dialogReturnValueCallback = Function.createDelegate( null, portal_modalDialogClosedCallback); As you can see from the above code, we set options on width, height and what is the URL the modal dialog should load. In this case, an Application Page. Notice that we also initialize the callback.
Once the options are set, you can now show the modal dialog:
SP.UI.ModalDialog.showModalDialog(options); Now warp this code into a function:
function po…

Remote Debugging Sharepoint 2010 Solutions

Image
Just spent an unreasonable amount of time getting remote debugging working with Sharepoint 2010 Sandbox *AND* Full-Trust solutions. It took quite a bit of work for me to understand and troubleshoot, so thought I would write it down:
a. for my own future reference
b. so others don’t have to go through the same heartache
The general approach for sandbox and full trust solutions is the same, but they do differ in a few details.
A post by tlhost on the Microsoft Forums titled A SharePoint server is not installed on this computer got me 90% of the way there, this is just filling in the gaps that tripped me up.
And a BIG THANK YOU to Pav – he helped a ton
Export Nodes from Sharepoint Machine Registry Remote to the Sharepoint machine, run regedit and export [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0]
On your development machine, run regedit and import the nodes.
Create Sharepoint project You will now be able to create a Sharepoint Project in Visual…

30+ SharePoint Custom Actions Location and Sample

exampleon how to add Custom Actions to various menus through a SharePoint Feature. The following guide provide complete reference for developer to examine the locations, group IDs and sample screenshots that are used in defining the CustomActionelements of custom actions. Additionally, you can download solution package (WSP) and source codes here: Sky Drive - CustomWare.SharePoint.CustomActionSample.zipPart 2 show examples of custom actions for SharePoint Central Administration Application Management and Operation page. In Part 3, you'll find additional missing custom actions group IDs and locations in MSDN
for Sharepoint Central Administration Shared Service Administration page. Part 2 - SharePoint Central Administration Application Management and Operation pagePart 3 - Sharepoint Central Administration Shared Service Administration pagePer-item edit control block (ECB) menu of document libraryCusto…