Skip to content

RER: 'ChangedItemProperties' not working on Document Library #4293

@rbarten

Description

@rbarten

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

When someone is using the 'Copy To' functionality. Also all metadata of the document is copied. We want to prevent this by clearing out particular (custom) columns with an synchronous ItemAdding event receiver. When adding values to the 'ChangedItemProperties' Dictionary of SPRemoteEventResult we would expect that the values of those columns are updated within a ItemAdding Event on a Document Library.

Observed Behavior

This won't work in SharePoint Online, nothing happens when setting these values. Sample code:

        SPRemoteEventResult result = new SPRemoteEventResult();

        if(properties.EventType == SPRemoteEventType.ItemAdding)
        {
            result.ChangedItemProperties.Add("cusField", "test");
            result.ChangedItemProperties.Add("Title", "test title");
            result.Status = SPRemoteEventServiceStatus.Continue;
        }

        return result;

Steps to Reproduce

  1. Create an ItemAdding EventReceiver and add values to the ChangedItemProperties.
  2. Add an ItemAdding eventreceiver to a Document Library using PowerShell (Not a Provider hosted app solution)
  3. Use the Copy To functionality.
  4. Event Receiver is triggered, but values are not updated.

If this is not supported. What other options are there to check if Copy To was used? Update the values within a ItemAdded async RER?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:add-insCategory: SharePoint Add-in Development Modelstatus:to-be-reviewedIssue needs to be reviewed by Microsoft for additional follow up / review.type:archive-old-issueIssues which are closed as tool old for active worktype:questionQuestion... if answered, will be tagged as such.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions