Two quick questions. Is there a way to prevent a document to open from an embedded view? If not, what is the best way to prevent someone from opening one of those documents if the main document the embedded view is on, is not in edit mode. Problem I have is, you launch the document from the embedded view, make changes, those changes are written back to the main document (parent) that the embedded view is on. If someone else puts the docuement in edit mode while you are doing this, you get save conflict docs. Any ideas?
You can prevent a document to open from that embedded view by writing a piece of code in the “Queryopendocument” event of that “view” (which u are embedding). If u have no conditions to check, you can simply say continue = False which makes the document, from that embedded view, never open.
OK, but what I do not know, is if I will still have focus on the uidoc. I would like to check to see if the document is in edit mode and if not, do not launch it.
Without opening the document, Unfortunately there is no direct way to find if doc is in edit mode.
Try setting flag fields from somewhere within the application(need to get set before you try to open from the embedded view) and find the value of a flag, depending on which, you can open the document.