Hi there,
I’ve been working on an application where prior versions become responses, but I want that behaviour to be under my programmatic control. I can accomplish what I want, but the view that was open when the revision document was created hasn’t fully refreshed properly. The new main document is there, the old main as a response is there, but the original responses to the old main are shoing as responses to the new main document…until the twisties are clicked and then they appear under the right document.
ws.ViewRefresh on my form’s PostSave (where I juggle the response hierarchy) has no affect. Can anyone steer me in the right direction or is this a bug?
Thanks…Neil
Subject: Just found $VersionOpt…testing now
Subject: Not good enough…
$VersionOpt doesn’t keep the children of the original document as children of the original document…they become children of the new version. Ugh. Do I have to use $VersionOpt and then hunt down all the responses and connect them to the old doc? Will THIS display in the view properly? If anyone has ideas, please let me know. Otherwise, wish me luck!
…Neil
Subject: Re: Not good enough…
Sorry, this response is a bit longwinded, but I just had to get this frustration out of my system.
I am currently working on a database using this versioning for the first time, and I was frustrated to discover this also. I think this is all due to how they set the UNIDs of the different versions. The prior versions are actually implemented as copies of the original, and they have different UNIDs, while the new/current version is actually the original document UNID. My guess is that they simply don’t update any $REF fields of the children other than making the prior version a response of the original.
And it doesn’t help that uidoc.SaveNewVersion has no way of telling you the prior version’s UNID. I had to come up with a kludge to determine the UNID of the prior version, in order to update the $REFs of the children to make them responses of the prior version. But this also meant I would have to change my security model to allow those $REFs to be updated. So I decided to give up on versioning.
Having given up on versioning, I decided that I would just create a new document, with values copied from the original, to be the new/current version, and make the original document a response of the new version. This worked fine until the original document (now a response) was refreshed or edited and saved, and then it got converted from a response into a main document because that’s what the form is. I thought it was strange that I could refresh or edit/save prior versions using Notes versioning and those would stay responses. What I discovered was that Notes will keep those documents as responses, despite the Form being a main document, IF there is a $VersionOpt item that is not set to “0”. But if I set $VersionOpt to something other than “0”, that turns on versioning, which I no longer want.
So now I think I will have to create a duplicate form and set it as “Response to Response”, and change the form of the original document when creating a new version.