I’d like to amend an existing value in a checkbox. The existing checkbox values are: “Train”, “Plane”, and “Accomodation”.
Please can you tell me if I can change the existing “Accomodation” option to “Accommodation” & if so, how do I accomplish, while still retaining entries under the old “Accomodation” value?
run an agent over all the old documents, to update the value to the new one
or
set an alias on the field (so in the properties box, set the value to “Accommodation | Accomodation”. The users will see the new spelling (even on old documents) but the old spelling is the value that will be saved, even for new documents.
Add code to the document PostOpen event to change the old value to the new - that way new and newly edited documents will get the new spelling, old documents remain un-altered but old documents opened again will show the correct setting for the check box.
There are probably more. It depends on your database design and what other impacts there are in say maintaining two values for the checkbox - will you need to change lots of other code which looks for the old value? Do you have views categorised by this field? etc.
FIELD Fieldname = @Replace(Fieldname; “Accomodation”; "Accommodation);
SELECT @All
The first line is an “escape”, making sure that only those documents with “Accomodation” stored in the target field are touched (this will minimise replication traffic). The “” action clause in the @If does nothing, passing processing to the next line, but the @Return(“”) clause halts processing on any document that does not have the “Accomodation” value. The second line replaces “Accomodation” with “Accommodation”, regardless of the order in which the values are stored or how many values are in the field. The last line is not strictly necessary in Notes and Domino 6 and higher, but was required in R5 and below – it’s left here for compatibility for anyone who finds the formula by searching, and it will not affect processing in ND6+, so you can leave it in place.