I am having a problem editing and saving an existing document from the web.
If a user clicks an Edit hotspot (which just contains @Command([EditDocument]), and then clicks another hotspot to approve a document, everything is fine, however, if I try to have the approval hotspot place the document into edit mode AND approve the document, updates are not made to appropriate fields and the document is not saved.
Here is the code I have in the onClick event of the hotspot:
var frm = document.forms[0];
url=location.href;
url=url.replace(“Open”,“Edit”);
window.location.href=url;
frm.dspStatus.value = “Approved”;
frm.Change.value = “Approved”;
change=location.href;
change=change.replace(“Edit”,“Save”);
window.location.href=change;
If I remove the last part (from change= to change;), I can see that the document is placed into edit mode, and that the fields are visually updated. If I place an alert to display change after the replace line, the correct url is displayed, it just doesn’t update the window.location.href. If I set window.location.href=“http://…” and the whole url including savedocument, I do receive the message “form processed”, but the fields have not updated, although the document properties indicates that it has been updated.
If I replace the whole savedocument portion with just frm.submit(), I receive the error message “Invalid syntax” on the frm.submit() line.
If I use the first part of the code to set the window.location.href to include editdocument, and then programmatically click a button using frm.CallDeanApproveAgent.click(), and use formula language in the button of @SetField, again, I can see the fields visually set, however, the minute I introduct @Command([FileSave]), I receive the message “@Function is not valid in this context”.
I understand from this forum that editdocument is done through a POST, while submission is usually done through a GET, so I have entered method=“POST” in the Other field of the HTML Tags tab of the hotspot properties in both of the buttons, but with the same results.
I have tried this in both IE 6 and Firefox Mozilla, with the same results.
This shouldn’t be rocket science, and yet it has me stumped. I do not want to open the document automatically in edit mode, as a) not all users have edit access to the documents (I do with the IDs I have been using to perform the update and save), and I want to preserve the look of the document in read mode should the user want to print it.
Any assistance would be greatly appreciated!