SharePoint – CQWP – XSLT in ItemStyle to Format Created Date

The goal is to display the created date with the full month and day:

Add the following namespace attribute to the root xsl:stylesheet element in ItemStyle:

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"

Create an xsl:variable element:

<xsl:variable name="Created">
<xsl:value-of select="ddwrt:FormatDateTime(string(@Created) ,1033 ,'MMMM dd')" />
</xsl:variable>

Use the variable:

<xsl:value-of select="$Created"/>

SharePoint 2010 – WebPart Header Rounded Corners

Lets use some fancy CSS3 properties to add rounded corners to the Webpart header bar. This solution won’t work in IE7 or IE8 but should work in IE9, Firefox, Safari, and Chrome.

Have a look:

.ms-WPHeader td { 
	background: #89CE2E; 
	border-bottom: none !important;  
}
.ms-WPHeader td.ms-wpTdSpace { 
	-moz-border-radius-topright: 5px; 
	-webkit-border-top-right-radius: 5px; 
	border-top-right-radius: 5px; 
}
.ms-WPHeader td:first-child.ms-wpTdSpace { 
	-moz-border-radius-topright: 0px; 
	-webkit-border-top-right-radius: 0px; 
	border-top-right-radius: 0px; 
	
	-moz-border-radius-topleft: 5px; 
	-webkit-border-top-left-radius: 5px; 
	border-top-left-radius: 5px; 
}
.ms-WPHeader h3, .ms-WPHeader h3 a { 
	color: #fff; 
}
.s4-wpcell:hover .ms-WPHeader .ms-WPHeaderTdMenu:hover { 
	background: #89CE2E; 
}

SharePoint 2013 – BootStrap – Search Box drop down options not displaying on certain pages

OK, I have run into another boggling situation where the default Search Box dropdown is not giving me the search options on my home page… but it is showing on most of the other pages in the site collection?

After some digging in the guts of the master page and and searching the inter-webs… I have a solution πŸ™‚

Just add a reference to ajaxcontroltoolkit in your master page and bob’s you uncle:

<script type="text/javascript">
          SP.SOD.executeOrDelayUntilScriptLoaded(function () {
         SP.SOD.executeOrDelayUntilScriptLoaded(function () {
RegisterSod("ajaxtoolkit.js",  SP.Utilities.Utility.getLayoutsPageUrl('ajaxtoolkit.js'));
}, 'strings.js');
}, 'sp.js');
</script>

Please note that if you are using Design Manager please add the below code to Bootstrap.html instead:

<!--MS:<SharePoint:ScriptLink language="javascript" name="ajaxtoolkit.js" OnDemand="true" runat="server" Localizable="false">-->
<!--ME:</SharePoint:ScriptLink>-->

If you get a chance please check out this CodePlex project: http://responsivesharepoint.codeplex.com/

SharePoint 2010- Link directly to InfoPath form template

OK so you have an InfoPath form and you need to put a link directly to the form on the main page of the site. We don’t want to link to the library itself and then get people to click the “Add Document” link on the bottom of the list because that is way too many steps and life will be better with less steps… πŸ™‚

We can do this Two Ways:

  • Choice 1:
    1. In InfoPath Designer, click the File tab.
    2. In the actions column, click Publish, and then click SharePoint Server
    3. In the Publishing Wizard, type the URL of the target SharePoint website, and then click Next.
    4. Verify that the Enable this form to be filled out by using a browser check box is selected, and that Form Library is selected.
    5. Click Next twice.
    6. Click Publish.InfoPath Designer first creates a new form library on the website and then publishes the resource planning form in the library.
    7. In the Publishing Wizard, click Open this form in the browser.The form opens in the default browser.
    8. Copy the entire contents of the browser’s address bar, and VoilΓ . The address bar contents should resemble the following.
      http://teamsite/_layouts/FormServer.aspx?XsnLocation=http://teamsite/ContosoResourcePlanning/forms/template.xsn&OpenIn=browser&SaveLocation= http://teamsite/ContosoResourcePlanning&Source=http://teamsite/ContosoResourcePlanning
      
  • Choice 2:
    1. Navigate to the SharePoint Library in your web browser
    2. At the bottom of the SharePoint Library, click the Add document button.
    3. The form will open in your browser.
    4. Copy the entire contents of the browser’s address bar, and paste it into Notepad. The address bar contents should resemble the following:
      http://teamsite/_layouts/FormServer.aspx?XsnLocation=http://teamsite/ContosoResourcePlanning/Forms/template.xsn&SaveLocation=http://teamsite/ContosoResourcePlanning&ClientInstalled=true&Source=http://teamsite/ContosoResourcePlanning/Forms/AllItems.aspx&DefaultItemOpen=1
      
    5. We need to chop up the URL and Add a few things:
      1. We want the form to always open in the browser so we need to add “&OpenIn=browser“.  Just paste it in between …/template.xsn and &SaveLocation=…
      2. SharePoint loves being a snot and opening forms on the client machine so just to be safe Please remove “&ClientInstalled=true“. This don’t always happen but for good measure we are going to remove it because it don’t actually need to be there πŸ™‚
      3. We are also going to remove “&DefaultItemOpen=1
      4. Your URL should now resemble the following:
        http://teamsite/_layouts/FormServer.aspx?XsnLocation=http://teamsite/ContosoResourcePlanning/Forms/template.xsn&OpenIn=browser&SaveLocation=http://teamsite/ContosoResourcePlanning&Source=http://teamsite/ContosoResourcePlanning/Forms/AllItems.aspx
        

That’s it… No honestly that’s it… Paste your URL where you need to place it and you are set. πŸ˜€

InfoPath: Set Check Box/Radio Button/Dropdown to Read Only

OK, So you are trying to set up a new view in InfoPath and you want to set a few fields from a earlier view to “Read Only”…. Simple… Well until you get to the couple of fields that don’t have that option in the properties menu?!?

Lets create a new rule:

1) Click the “Home” Tab at the top of InfoPath
Home
2) Click “Manage Rules”
Manage Rules
3) Now make sure you select the field that you want to set to read only
Select Field
4) Select “New” in the Rules option box and Select “Formatting”
New Formatting Rule
5) Under the “Condition:” heading, click “None”
Add Condition

6) In the first drop down select “The Expression”

7) Clear out the text box and enter “1”
Expression
8) Click OK

9) Now at the bottom of the rule, click the “Disable this control” check box
Disable this control
Honestly that’s all you have to do!
Take care

SharePoint 2010: Reusable Workflow Form Error

So you take a copy of the  ‘Approval – SharePoint 2010’ workflow, and you make some changes. But after publishing the workflow, and adding it to a list on a site, you try to add a Approver and/or a CC you get the following error when the page does a post back:

1This lovely error is due to SharePoint designer security update, KB2553322 (Security update for InfoPath 2010: July 10, 2012). This error has apparently been a huge pain in developers butts all over the world. The truth is I have tried every recommend solution on the net and this is the only solution that worked!!!

 Solution:

Please Note: This solution will have to be performed whenever the workflow is modified.

  • In SharePoint Designer, go to All Files.

2

  • Navigate to:
    • Local workflows:  Workflows > select the name of the workflow.
    • Global workflows:  _catalogs > wfpub > select the name of the workflow.
  • Open the β€œWorkflow Name” .xoml.wconfig.xml file.

3

 

 

  • Click the Edit File link.

4

  • Navigate to the β€œDefaultData” Section

5

  • Remove xsi:nil=”true” from the Assignee and CC Fields.

6

…

7

  • It should now look like this.

8

  •  Save the file and your done!

Happy Coding!

PeopleSoft 8.4 Project Documentation (with PeopleCode) in less than 5 minutes!!

As a developer you have probably spent countless hours developing or modifying an application and now you have to do the worst part… The Documentation!!!! DUN DUN DUUUUUUUUUUUUUN Usually, you would go through your project in app designer and write down all the objects for your migration form and then start copying and pasting all your code for your technical documentation… Boring!!! Why can’t I just add a little piece of code to a XML file and everything will be done for me??? Well now you can, thanks to the below script!!!!!
Step 1:

  • Exported your project to a file.
  • Please note: You have to export everything to the file!! You have to change everything to copy/upgrade…
  • When you export the project to a file it created; an .XML file and a .INI file. (you can delete the .INI file)

Step 2:

  • Place the following file named PeopleCodeViewer.xls into the Project folder with the project .XML we just created above.

Step 3:

  • Modify the .XML file in your project folder by adding the following two lines to the top of the XML file under the line –

<?xml version='1.0'?>

Add:

<?xml-stylesheet type="text/xsl" href="PeopleCodeViewer.xsl"?>
<root>
  • Then add the following line of code to the bottom of the .XML file
</root>
  • Save and close the .XML file
Step 4:
  • Open the .XML file in a web browser and Vola

Step 5:

  • press Ctrl-A and paste into word and your done