Thanks!
I'm not sure where the missing bracket behind typeof is on the following line though:
if (typeof d.getDocument(true)==null) { sessionScope.informationMessage = "Problem saving the case: myUser.getCurrentDocument()" + " returned null. Please try saving again."; } |
I will make the change you mentioned however to check it's not undefined or "".
As for why it was written this way, it's another example of me trying to code around the problem. We were getting the null document errors when trying to Save a datasource so I thought if I added some code to try and re-establish the connection to the data source it might help. I previously just had currentDocument.save() instead of a call to this function to try and return the document and then save it. Maybe now we have the new server (that seems more stable) I should be reverting the code back to the simple way of doing things and hope that it helps ?