Validating multiple items in SharePoint 2010 Add document option

Hi, I have an Item Added event receiver defined (marked as Sychnronous) to validate documents added to a library against settings in the SPList property bag. That allows me to delete items that are not valid. I intend to add a warning alert for the user for deleted items.

When the user takes the option to add multiple items, I would like to present a summary of rejected documents to the user. I have no idea how to tackle this.

I would be grateful for any ideas.

April 17th, 2015 12:21pm

Hi,

Per my understanding, there is an event receiver in your library can detect and delete invalid items, now you want to show a summary of the invalid items to users.

As a suggestion, you can create a custom popup window using JavaScript to display the content you want.

To achieve this, in the event receiver, redirect user to a custom page plus query string after adding items, the information about the invalid items can be added into the query string. Then in master page, add some JavaScript to extract the query string from URL if user in the current library list view, display a popup window with the invalid items information.

A demo about how to redirect to other page in event receiver:

http://www.c-sharpcorner.com/UploadFile/3a164c/custom-messages-using-event-receiver-in-sharepoint/

About how to extract query string from URL using JavaScript:

http://www.joezimjs.com/javascript/3-ways-to-parse-a-query-string-in-a-url/

How to display a popup window using JavaScript:

http://www.w3schools.com/js/js_popup.asp

Adding JavaScript and CSS to SharePoint

http://techtrainingnotes.blogspot.com/2012/05/adding-javascript-and-css-to-sharepoint.html

A similar thread with some useful posts would be helpful to you:

http://sharepoint.stackexchange.com/questions/44791/how-to-use-sharepoint-notification-from-event-receiver

Thanks 

Patrick Liang

Free Windows Admin Tool Kit Click here and download it now
April 19th, 2015 10:32pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics