Save Conflict When Doc Open

I have 2 documents (docA & docB).On docA there is a form action which composes a different doc - docB.

docB is edited and saved. In the QueryClose event of the form some of the values in docB get transferred back to docA. A notesdoc.Save is called to save docA and docB is closed. docA has stayed open the whole time. This is the problem. Once I am back in docA, I finish editing and call filesave and closewindow (formula). This then brings up the save conflict error message. It seems that when I tried to save docA because it was still open, it is trying to save at the same time I am editing it and causes the conflict… I think. So the question is how to save docA from docB without having this error. The problem could also be the way in which I transfer the values back to docA. Although docA is open, I am using getdocumentbykey and replacing the values from the back end… is there anyway I can do this another way…?

Hope I haven’t confused…

Subject: Save Conflict When Doc Open

When closing docB, write the values to environment variables or a profile doc for temporary storage.

When you close docA, get those values before you save it.

Subject: Save Conflict When Doc Open

There’s no way for the second document you open to refer back to the original document’s editing window (that I know of). I can think of a few possibilities.Think about whether you can combine A and B into a single document. This download contains tools for storing variable-length tables on your main document, which can sometimes be used in place of a main document and subsidiary documents.

Can you avoid making changes to the original document by not storing information from the secondary document? Instead, you could calculate it for display on the main document form as needed – either by an @DBLookup to read fields from the secondary documents, or by embedding a single-category view on the main form.

Use the NotesUIWorkspace.Dialogbox method to present the user a modal dialog for them to enter the fields of the new document (create a new back-end document to pass into Dialogbox, and use the back-end save function to save it after the user clicks OK). Then, since the code that opened the dialog is running on the A document, it could use update the current UI document.

Make up a new way.

Subject: Save Conflict When Doc Open

That works perfectly David, cheers!

Subject: RE: Save Conflict When Doc Open

Yeah, that works OK provided doc A is still open by the time you close doc B. However, users can close windows in any order.

Also wondering whether you tested the case where you create 2 doc B’s before closing the doc A. Or if you have two doc A’s open at the same time, and you create a doc B for one doc A, then close the other doc A.