Link to home
Start Free TrialLog in
Avatar of jalcadmin
jalcadminFlag for United States of America

asked on

Sharepoint Folder Error Trapping

I am working on a Sharepoint Integration that leverages SP's email functionality to create folders and email documents into document libraries.  Basically I have an application that autofires and email to the library with a record number as its subject line, thereby creating a folder in SP for that record.  The application then has a button that, when pressed, points to the url of the folder and opens the folder so that they can add documents to it.  The email process seems to work out fine except that SharePoint has a delay in creating the folder so that there is a minute or two that the folder may not exist.  That would also be fine except that when you open a document library using a url to a folder that doesn't exist, SharePoint points you to the document library's root rather than throwing an error message that I could trap.   This leaves a minute or two in which the user could upload to the root directory and not know it, and then not be able to find the document.  There is also the possibility that something could go wrong in the email process and SharePoint would not create the folder, in which case any user that tried to upload from that record would be putting their files in the root folder.  Does anyone know of any way that I could force SharePoint to throw an error when it is directed to an invalid folder ID, rather than redirecting to the root folder?

Thanks,
Hassab
Avatar of jalcadmin
jalcadmin
Flag of United States of America image

ASKER

Sorry, need to clarify.  I have set up a web part page through which the document library is viewed.  The web part page removes headers and side bars using content editor web part.  When I go to an invalid folder in SP using the document library standard view I do get an error, however, via a web part page there is no error, just a view as if the folder was indeed valid.

Thanks,
Hassab
You could check if the folder exists before you show the link.
ASKER CERTIFIED SOLUTION
Avatar of jalcadmin
jalcadmin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial