Is there anyway to copy your doc when you save it in two different forms. (PersonInfo1 and PersonInfo2)I also want to check if there are any person with same personname and companyname.
If there are that i just want to create one copy.
How will a go further?
Kind regards
Fredrik
Subject: Copy doc when you save?
It sounds to me like you are asking how to not overwrite an existing document when creating a new one with the same values in certain fields? If I’m reading you right, then this won’t happen, so you have no worries. If I have misinterpreted your meaning, try restating your question.
Subject: RE: Copy doc when you save?
HiThanx for your answer.
What i want is a copy with a different formname when i save my first form.
I also want to check before it’s create a copy if there already is a saved form with that personname and companyname in it.
If there already is a created copy with person/companyinfo i will only save the first form.
Defaultformsname is PersonInfo and the form a want to use when a create a copy is cPersonInfo.
The viewname is Person.
Kind regards
Fredrik
Subject: RE: Copy doc when you save?
I think I get it now; you want a permanent copy of the original version of the document, and all subsequent edits will occur against a “live” version.
There are probably several ways of achieving this; one would be to have the user compose the new document using the PersonInfo form. In that form’s querysave event, you’d code something like
'dim and set db
dim doc as notesdocument
dim newdoc as notesdocument
set doc = source.document
'do all validation here; don’t use field-level validation
'if the document validates, then:
set newdoc = db.createdocument
doc.copyallitems newdoc
newdoc.form = “cPersonInfo”
newdoc.save true, true
This will fail to copy any rich text items, however; the laziest way to pull that one off is probably to use uidoc.send instead of the above.
Subject: RE: Copy doc when you save?
The Versioning feature of Notes may let you do this without any coding (or at least, just a couple of short formulas)
Subject: RE: Copy doc when you save?
But versioning will give a new version at every edit, instead of only one backup copy of the original doc.
I originally thought of using versioning as well, but the kludge required (a Form field which changes to a second version of the form w/o a versioning property, perhaps based on $REF) seemed clumsy and not easily maintainable.