Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm using event receivers to modify some of the inputs in a SharePoint 2013 site.

They are fairly straight forward, here is a simple example

public override void ItemAdded(SPItemEventProperties properties)
{
    base.ItemAdded(properties);

    using (SPSite site = new SPSite(properties.WebUrl))
    {
        using (SPWeb web = site.OpenWeb(properties.RelativeWebUrl))
        {
            //web.AllowUnsafeUpdates = true;
            SPListItem item = properties.ListItem; // Boom!
            var title = item["Title"].ToString();
            item["Title"] = title.Replace(" ", "_");

            //item.Update();
            //item.SystemUpdate(false);
        }
    }
}

This renders the error

Message:
    Method not found: 'Microsoft.BusinessData.Runtime.IEntityInstance Microsoft.BusinessData.Runtime.NotificationParser.GetChangedEntityInstance(Microsoft.BusinessData.MetadataModel.IEntity, Microsoft.BusinessData.MetadataModel.ILobSystemInstance)'.

Source:
    Microsoft.SharePoint

StackTrace:
   at Microsoft.SharePoint.SPItemEventProperties.get_ListItem()
   at eventreceivers.Kundregister.PrivateCustomer.PrivateCustomer.<>c__DisplayClass2.<ItemAdded>b__0()
   at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
   at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)

I have ensured that those methods are available in the class.

Any advices are highly appreciated, thanks!

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.