This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jun 1, 2014, 7:54 AM
18 Posts
topic has been resolvedResolved

Saving to Backend Document

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Administrator,Developer
  • Tags: Save Conflict
  • Replies: 6

I have an form which has an embedded view. The user is able to open a document from with the embedded view by double clicking it and may then edit that document. When saving this document, it writes a field value back to the main document from which it selected and closes. When trying to save the main document, you are prompted with "Another copy of the document was saved while you were editing it. Save your changes as a conflict document". 

Does anyone know of a way to do this without having a save conflict?

Is there anyway of saving and closing a UI document that doesn't have focus (i.e. not the current document)?

Any help would be greatly appreciated.

Jun 2, 2014, 1:50 AM
11 Posts
Re: Saving to Backend Document

This is a trick I use to achieve your goal. uidoc is the uidocument object of the sub document. docApp is the main document.

    Call ws.ViewRefresh
    Call uidoc.Close(True)
    Set uidoc=ws.EditDocument(True, docApp, False, ,True , False)

    ‘You can modify the main doc via a new uidoc or its Document property now.
 

Jun 2, 2014, 2:40 AM
18 Posts
Saving to Backend Document

Hi Starrow,

Thanks for your reply. I am not sure but won't this close the document that was opened from the embedded view? I need to close the main document that the new document was opened from. Please excuse my ignorance.

Also, where would you place this script for it to work?

Thanks in advance.

Jun 2, 2014, 2:40 AM
18 Posts
Saving to Backend Document

Hi Starrow,

Thanks for your reply. I am not sure but won't this close the document that was opened from the embedded view? I need to close the main document that the new document was opened from. Please excuse my ignorance.

Also, where would you place this script for it to work?

Thanks in advance.

Jun 2, 2014, 4:22 AM
11 Posts
Re: Saving to Backend Document

Hi Philip,

Per my understanding, you want to update the main document A from the sub document B, then modify A from A. Special cautions need to be taken in this case to prevent save conflicts. The most safe way is to only edit A in one place. So after editing and saving B, close it optionally and edit A. The values that need to be written back to A can be now retrieved from B. You can put the scripts in the save action of B. Actually it won't close B instantly but the focus will be transferred to A and the modifications done to A in the script from now on are the same as those directly done to A and will not incur save conflicts.

Jun 2, 2014, 9:42 AM
18 Posts
Saving to Backend Resolved

Thanks Starrow. Your a life saver!

Jun 2, 2014, 9:42 AM
18 Posts
Saving to Backend Resolved

Thanks Starrow. Your a life saver!


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal