Monday, April 11, 2011

SharePoint Workflow does not start automatically (kb947284)

I was able to start my workflow automatically which I created through SharePoint Designer. 

Firstly I checked out instructions from this article kb947284. In my case regarding to kb947284 I was logged in with "System Account". So I took some other user from sharepoint member group and logged back in, but with no luck...

After hours of endless searching i came across to something like this: "If I browse my sharepoint web page with IP address instead of hostname automatic workflows wouldn't start!!!"

Friday, April 1, 2011

Sharepoint 2010 Foundation install Step By Step

My goal was to install Sharepoint Foundation 2010 (SPF2010) so that web application is on one server and the database is on seperate server.

So these were my steps:


Tuesday, March 29, 2011

Latest earthquakes in the World

Very usefull online information tool to get info for latest earthquakes and volcanos in the world

Monday, March 28, 2011

How long does it take to drive through Riga city ?

I must say that this is not a story about THIS. My approach was more realistic and much safer :)I took my car to drive through city Riga from one city border to another simply to check how much time do i need to get through this city within legal limits.

Thursday, March 24, 2011

Get current SharePoint User with JavaScript

During the SharePoint form customization in many cases it is important to know the current user. So with JavaScript and SharePoint Designer this is how it's done:

var loginElement = document.getElementById("zz7_Menu").innerHTML;
var end = loginElement.indexOf("<");
var nameOnly = loginElement.substring(8, end);

note: I use this script in MOSS2007, but if you use this in WSS3 change "zz7_Menu" to "zz6_Menu".

My whole point using this script was to get the current username (in my case organization username format is: username14, username57 etc.) And based on that I need to get only numbers from this username. So there is my complete solution:

var loginElement = document.getElementById("zz7_Menu").innerHTML;
var end = loginElement.indexOf("<");
var nameOnly = loginElement.substring(8, end);
var number = nameOnly.replace (/[^\d]/g, "");
var k;

if (number != "") {
var elements = document.getElementsByTagName('select');
for (var i = 0; i < elements.length; i++) {
if (elements[i].title == 'YOUR DROPDOWN TITLE'){
var sel = elements[i].options.selectedIndex = number;
for (k=elements[i].options.length-1;k>=0;k--) {
if (k != sel) {
elements[i].remove(k);
        }
      }
    }
  }

}