Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Personal Dashboard Auto Forward code

  Asked By: Abhishek    Date: Dec 02    Category: Sharepoint    Views: 2252

I have finally figured out how to automatically forward a user to
his/her personal dashboard if they have one. The way this was
developed was to have two webparts in a subdashboard created to
develop a new personal dashboard. From the management subdashboard
tab on our main page, I exported the "personal dashboards" webpart
and imported it into the personal dashboard subdashboard. I then
created a new webpart and added the following code (which you'll
want to tailor to your own needs) so that if the logged on user HAS
a personal dashboard, it would automatically forward them to it...
if not, it would leave you in the personal dashboard subdashboard
with the option to create one. This new webpart will need to be set
in advanced settings to not show in the dashboard, so that the user
will not see the error that results when a personal dashboard does
not exist.

The following code should go in the "Embedded content" section of
the advanced settings of the new webpart, and "type of content"
would be VBScript:

****** code start ******

Function GetContent(nod)
On Error Resume Next

dim curUser
dim objfso
dim istatus
dim strURL

set objfso = CreateObject("scripting.FileSystemObject")
userArray = split(GetServerVariable("LOGON_USER"), "\")

if UBound (userArray) > 0 then
curUser = userArray(1)
curUser = userArray(0)
end if

strURL = Server.MapPath("../../dashboards/" & curUser & "/")
set istatus = objfso.GetFolder(strURL)

if istatus = strURL then
Response.redirect ( GetWorkspaceURL() & "/dashboards/" &
curUser & "/" )
end if

End Function

******* code end *******



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Personal Dashboard Auto Forward code Or get search suggestion and latest updates.