use the following code to get the item from ItemAdded Event.
Public Overrides Sub ItemAdded(ByVal properties As SPItemEventProperties) Using spsSite As SPSite = New SPSite(properties.WebUrl) Using spwWeb As SPWeb = spsSite.OpenWeb
Dim iSPl As SPListItem
If spwWeb.GetFile(properties.AfterUrl).Exists Then iSPl = spwWeb.GetFile(properties.AfterUrl).Item
ElseIf spwWeb.GetFolder(properties.AfterUrl).Exists Then iSPl = spwWeb.GetFolder(properties.AfterUrl).Item End If
End Using End Using End Sub
Entries Tagged as 'SharePoint'
Event Handler ItemAdded returns null value
August 3rd, 2010 · No Comments
Tags: SharePoint
You must restore to an empty web site
August 2nd, 2010 · No Comments
not following the directions caused me to get stuck on this one.
using SharePoint Designer, backup the site you want.
Site –>Administration –>Backup Web Site –> Select a location and save
create an empty site. (this is where i messed up)
to create an empty site do the following:
File –> Web Site –> General –> Empty Web Site –> [...]
Tags: SharePoint
SharePoint The user does not exist or is not unique.
July 7th, 2010 · No Comments
Error
The user does not exist or is not unique.
To fix this error try changing the Group Owner.
Group –> Settings –> Group Settings –> Owner
Tags: SharePoint
InfoPath Hyplerlink opens as Read Only
June 25th, 2010 · No Comments
Recently ran into an issue where you place a hyperlink on a InfoPath form, user clicks the link, the item opens as read-only, no Edit Document option.
The fix is to do a regedit to allow for editing of the document.
example
[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Internet]“OpenDocumentsReadWriteWhileBrowsing”=dword:00000001
in the Common\Internet folder you would create a new DWORD value OpenDocumentsReadWriteWhileBrowsing and assign it a [...]
Tags: InfoPath · SharePoint
Access is denied. (Exception from HRESULT: 0×80070005 (E_ACCESSDENIED))
June 10th, 2010 · No Comments
Trying to use an Event Handler in SharePoint 2007 my test user was seeing this error:
Access is denied. (Exception from HRESULT: 0×80070005 (E_ACCESSDENIED))
The error was being triggered by an ItemUpdated or ItemAdded event.
fix:
Public Overrides Sub ItemUpdated(ByVal properties As SPItemEventProperties) SPSecurity.RunWithElevatedPrivileges(AddressOf mCode) End Sub
Private Sub mCode() Dim eFire As hEventFiring = New hEventFiring Using [...]
Tags: SharePoint
Lookup field, Value does not fall within the expected range
June 2nd, 2010 · No Comments
Using a Workflow to update a Lookup field in a Library in SharePoint I ran into this error:
Value does not fall within the expected range
I had no issue obtaining the value of a value from the Lookup field.
Dim sString As New SPFieldLookupValue(DirectCast(wfP.Item(“Field-R”), String)) sString= sString.LookupValue
BUT, what I failed to pay attention to was the hyphen [...]
Tags: SharePoint
workflow to get the value of Lookup field
May 27th, 2010 · No Comments
In Visual Studio 2008.
I was trying to get the value of Lookup field in a Document Library and would see a result like this:
sLookup = workflowProperties.Item(“FieldName”).ToString
but it returns: 9;#FieldValue
This is how I went about fixing the string (if there is a better way, please tell me!)
sLookup = Right(workflowProperties.Item(“FieldName”).ToString, Len(workflowProperties.Item(“FieldName”).ToString) – InStr(workflowProperties.Item(“FieldName”).ToString, “#”))
Tags: SharePoint
Update the Assigned To field using a Visual Studio 2008 Workflow
April 13th, 2010 · 4 Comments
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 [...]
Tags: SharePoint
workflow to get current site name in Visual Studio 2008
April 12th, 2010 · No Comments
Dim siteName As String = workflowProperties.WebUrl
easy…
In Visual Studio 2008 I was trying to get the current sites URL. Doing this will allow for the workflow to be dynamically used in other sites.
Tags: SharePoint
CopyTo in Visual Studio
April 9th, 2010 · No Comments
CopyTo sharepoint workflow visual studio
Tags: SharePoint