문제

I've created a custom edit form, and the attachments functionality is half-broken. When I click the attach button, it takes me to the attach form and I can browse, select a file, and hit OK. That all works, and the file is actually attached. The problem is that it looks like it didn't work, because the attach form just clears the file name field and doesn't redirect back to the form.

Has anyone encountered this before? As far as I can tell, this isn't the usual custom form attachments problem. As I said, I can attach files. It just looks like I can't.

도움이 되었습니까?

해결책

Okay, so after some debugging I found the problem and, even better, the solution.

The OK button on the attach form runs a script called OKAttach(), which features a line towards the end that reads:

document.getElementById("idAttachmentsRow").style.display="";

All well and good, except that at some point SharePoint sneaked behind your back and did this to the attachments row:

<tr id="idAttachmentsRow{generate-id()}">

Which means that there is no row with an id of "idAttachmentsRow" and the script breaks. Simply go in and delete out the generate-id() function and everything's fine again: attachments are attached and you're redirected back to the edit form.

다른 팁

You can also create a new, empty, element with the appropriate id. This also seems to restore the "proper" look and feel.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top