Monday, March 25, 2013

Infopath set year in form

To set a value for a field upon loading, use textbox properties and Default value instead of rules.
To get the current year, use formula : substring(today();0;5)

Friday, March 22, 2013

Infopath and lookup columns in workflows

When creating items using workflows its important that the values are exactly matchable. For instance, if the value in the list is a lookup value from another list, like employes, its important that the value that gets sent is the actual ID of the employee.

Its gets more complex when using infopath to edit a workflow forms. Here we got another layer that needs to be exactly matched. In this instance we needed to use another lookupfield in the actual infopathform and pass that form variable to the workflow.

When getting values to a dropdown-list from a external datasource, like a sharepointlist, the default behaviour is that value is the same as display name. When this value needs to match to another lookupfield the value-field needs to be changed to ID. Otherwise the workflow will just die.


Can’t edit or create maintainance jobs in SQL Management Studio

Error: Agent XPs component turned off off as part of the security configuration….



Executed following:

sp_configure 'show advanced options', 1;
sp_configure 'Agent XPs', 1;

Threw an some error but after this it was possible to edit again.


Outlook keeps crashing

Outlook crash upon startup.

Running in safe mode gives same result, running offline aswell. Event Log shows Application Error with Faulting module name KERNELBASE.dll


Solution: Repair the local OST-file

C:\Program Files (x86)\Microsoft Office\Office14\scanpst.exe


Thursday, March 21, 2013

Error when trying to open Infopath 2010 from SPD 2013

I need SPD 2013 to work with Sharepoint 2013 effeciently. though I have an emailserver that’s using Exchange 2003 so I can’’t install Office 2013. Which means my infopath is version 2010. This issue arises when I from Sharepoint Designer tries to edit a form with Infopath.

Error given is: To open this file, you must first install Microsoft InfoPath 2013 on this computer.

To resolve, without upgrading Office, install Microsoft KB2804405


Check Office licens

From \Microsoft Office\Office14\ folder run

cscript ospp.vbs /dstatus to check.

might come in handy if need to find out where the user got his key from.



Displaying different Infopathforms in list

For some situations we might want to show a list, like when we’re creating an Item. While other situations we need to see a more clean view, like for printing and such.

Enter Infopath views! under Page Design > View , we can create a totally different form, but based on the same listitem. image

There’s already an Printview inplace but we can create a new one for viewing.

Now, we’ve create a new view and we want this to be the default one when clicking View Item in a list.

  1. Under List>Customize List>Form Web Parts v>[ContentType Forms] (Item) Display Formimage
  2. Edit Infopath form Web part, change Views to your preferred view, like Printview



Its also possible to create a button in a form and switch views by clicking farily easy.

  1. Create button
  2. Control Tool>Properties>Add Rule>When this button is clicked>Switch Views



Tuesday, March 19, 2013

Infopath calculate time difference between two inputs

Need to get the number of hours between two timeinputs in infopath. This will always be on the same day.
60 * (substring(laterTime, 12, 2) - substring(earlierTime, 12, 2)) + (substring(laterTime, 15, 2) - substring(earlierTime, 15, 2)) + (substring(laterTime, 18, 2) - substring(earlierTime, 18, 2)) div 60
When pasting this to a field in infopath, we first need to remap latertime and earliertime to relevant fields in our own form. When trying to verify the formula it throws an error stating a missing ,
Upon closer examination of the xpath values we notice than an extra . is in place where the , should be .
When the dots are are replaced with commas the code works as it should.

Friday, March 08, 2013

Lockscreen shortcut

When bouncing about on different desktops, virtual and otherwise physical its easy to leave a computer unlocked sometimes. This isn’t so good, but shortcuts tends to flip out when accessing remote systems. A good security practice is to create a desktop shortcut that can lock the computer very easily.


1. Create a shortcut

2. Enter: rundll32.exe user32.dll,LockWorkStation

3. Save and change icon to a padlock or something more logical. This among other icons can be found in Shell32.dll under system32