0

Question is it possible to get the parent folder data eg(Title, Custom Columns)?

What I want to achieve is when an user add an item i could pre-populate columns with data i want.

I've manage to create this in ItemAdded so basically i need to get the ItemID so i could get the parent folder but since i need to do this in ItemAdding the ItemId still doesn't exist.

Is there any way i could get the parent folder data using the ItemAdding Remote Event Reciever?

Thanks!

0

In ItemAdding event recievers should be parent folder like this:

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

       //file doesn't exist, but here is the parent folder
       SPFolder f = properties.Web.GetFile(properties.AfterUrl).ParentFolder;

       //you can work with this property
       if (string.IsNullOrEmpty(f.ParentFolder.Url)
       {
            //code for populate columns
       }

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.