InfoPath get current username

If you are looking for a way to capture the login user name in InfoPath try this.

Dim sUserName As String = System.Enviroment.UserName

If you want to capture user name from SharePoint try this:

http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

Update the Assigned To field using a Visual Studio 2008 Workflow

After spending way too many hours messing with this, I got it to work. I was trying to update the Assigned To in a Form Library (also works in a Document Library) using a Workflow in Visual Studio 2008. SharePoint being SharePoint, nothing is ever easy.

In the VS I created a Sequential Workflow. Then I added a Code activity (codeActivity1) to the design. After that, double click codeActivity1 in the design window.

Create the Public variable wfP:

Public wfP As SPWorkflowActivationProperties = New Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties

Then add the following code to your codeActivity1 module.

Dim site As SPWeb = New SPSite(wfP.WebUrl).OpenWeb()

Dim list As SPList = site.Lists(wfP.List.Title)

Dim listItem As SPListItem = wfP.Item

listItem(“Assigned To”) = site.Groups(“gLeads”)

listItem.Update()

It should look like this when you are done:

Private Sub codeMoveToLead_ExecuteCode(ByVal sender As System.Object, ByVal e As System.EventArgs)

Dim site As SPWeb = New SPSite(wfP.WebUrl).OpenWeb()

Dim list As SPList = site.Lists(wfP.List.Title)

Dim listItem As SPListItem = wfP.Item

listItem(“Assigned To”) = site.Groups(“gLeads”)

listItem.Update()

End Sub

Trying to set the .AssignedTo never worked for me.

CopyTo in Visual Studio

I’m a little rusty on writing code and this is something that I spent way too much time messing with.

Dim destURL As String = “http://sitename/OtherLibrary/”
workflowProperties.Item.CopyTo(destURL & workflowProperties.Item.Name)

It’s not as simple as saying copy from/to. The CopyTo wants a URL, file name, and file extension.

If you receive this error:

Cannot create an item at the requested destination.  Verify that the folder exists and that you have permission to edit in it.

Start by checking your syntax.

Unable to open workflow in Designer 2007

Recently tried a STSADM export / import to move a site to a new collection.  After the STSADM import I tried to open a workflow using SharePoint Designer and received the following error.

The server could not complete your request. Contact your internet service provider or Web server administrator to make sure that the server has the Frontpage Server Extensions or SharePoint Services installed.

The fix was to recycle or restart the SharePoint server.

security shield has been installed successfully

Not sure what trigged this but es no bueno.

Sites I had open when this popped up:

techreport.com, 1and1.com, hostgator.com, and a google search.

I didn’t click Ok, but instead I opened Task Manager and found some random process with a description of wblpkjdfw located here:

C:\Users\e\AppData\Local

To be safe I’m running a full scan using Malwarebytes.

Parameter name: errorData SharePoint 2010

When creating my SharePoint 2010 sandbox farm I wasn’t able to get past connecting to the database server.  This is the error I was seeing:

An error has occurred while validating the configuration settings.  An exception of type System.ArgumentNullException was thrown.  Additional exception information: The errorData argument cannot be null or zero length.  Parameter name: errorData

I logged into my SQL Server 2008 R2 VM and updated the Start Mode of SQL Agent and SQL Serve Browser to Automatic.

What / Where / How

Start –> All Programs –>SQL Server XXX –>Configuration Tools –> SQL Server Configuration Manager

After it opens select SQL Server Services, right click on SQL Server Browser, select properties, click on Service, then set Start Mode to Automatic.  Repeat these steps on SQL Server Agent service.

After doing this I restarted the server.

——– edit

if you are having trouble finding your SQL Server, Server Name try looking here:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER

SNI10.0 — LastConnect

There you will find the name of your SQL Server

NTLRD is missing

Total noob error on my part.

rebooted my test box and started to see this error:

NTLRD is missing

Turned out that my system was trying to boot from an external hard drive I had connected to the box. Unplugged the drive and rebooted and the system is back to normal.

Windows Server 2008 R2