Skip to main content

Posts

Showing posts with the label SharePoint 2007

How to Write An SPQuery Using Multiple AND OR Operators

Writing CAML queries can sometimes make your head hurt. Not because it’s terribly complicated, but because there’s not much useful information out there that demonstrates, with REAL examples, how these should be written. So let’s see if we can clarify this: Scenario 1 Get me all items in a list WHERE fullName equals the currently logged in user. 1 2 3 4 5 6 7 8 9 10 11 SPWeb web = SPControl. GetContextWeb ( Context ) ; string fullName = web. CurrentUser . Name ; SPQuery oQuery = new SPQuery ( ) ; oQuery. Query = "<Where>" + "<Eq><FieldRef Name='FullName'/><Value Type='Text'>'" + fullName + "'</Value></Eq>" + "</Where>" + "<OrderBy><FieldRef Name='StartTime' Ascending='FALSE'></FieldRef></OrderBy>" ; Scenario 2 Get me all items in a list WHERE fullName equals the currently...

Share point Validation

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: InputFormRequiredFieldValidator InputFormRangeValidator InputFormCompareValidator InputFormRegularExpressionValidator InputFormCheckBoxListValidator InputFormCustomValidator If 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 control This control ...

Remote Debugging Sharepoint 2010 Solutions

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 Proj...

30+ SharePoint Custom Actions Location and Sample

Adding Custom Actions in SharePoint is a straightforward process - MSDN has excellent   example   on 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  CustomAction   elements of custom actions. Additionally, you can download solution package (WSP) and source codes here: Sky Drive  - CustomWare.SharePoint.CustomActionSample.zip Part 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 page Part 3 - Sharepoint Central Administration Shared Service...