Form deleted on local replicas after design change

Good morning. I have a serious problem that I am going to have to explain to an as of yet unknown number of users. Recent design changes were made in a heavily used application and two of the primary forms are disappearing in local replicas! What is unusual is that all of the other design changes were replicated down normally and are ok. I don’t understand why two forms would just disappear entirely. Has anyone else had this happen recently and possibly have an explanation as to why it happened? In addition, the only way I can get the forms back is to create a new local replica. I can’t get them to pull down by editing and resaving or by clearing the replication history.

Best Regards.

Amy

Subject: Is there a Read/Write prohibition on the forms?

In the properties of the form, there is the ability to restrict who can use the form. If that is not set correctly, that will cause the form to disappear. It happens more with other design elements, but I think that it happens with the forms as well.

Subject: RE: Is there a Read/Write prohibition on the forms?

I double checked to make sure there were no restrictions and there are not. Default read access is Reader access or above and who can create documents is Author access or above.

Subject: Form deleted on local replicas after design change

Do you ever paste Forms into the server database, and then use the Refresh Design option ? That can create symptons as you’ve described, and the solution is never to paste any design elements - always use the Refresh Design option.

The underlying reasons for this are quite complex. I did have a post on this, but cannot seem to locate it.

Subject: RE: Form deleted on local replicas after design change

That’s good information to know because I have, on occasion done that with other elements such as agents. However, in this case, I did do a design refresh from my development database and all appeared just fine on the prod server.

If you happen to come across your post again, please forward it to me because I am curious about the underlying causes for this.

Subject: RE: Form deleted on local replicas after design change

I know it’s out there, but I can’t find it … let me repost. These are copies of notes I sent to my co-developer when we had an issue, like yours, with design elements going missing or reverting to a prior version.

Whew … after digging into the depths of the database with NotesPeek (a wonderful tool) I now know exactly what’s going on, and how to easily fix it.

I’ve already taken the appropriate action with the LNET system for the IBM forms I knew we were having trouble with.

When Notes does a replication, it needs to know what has changed in order to move those changes from the server copy to the local copy. The key to the problem we’ve been seeing it that it does NOT use the date/time of the change to decide this, but looks at each document’s sequence number. This is a number that’s incremented each time a document is changed.

What’s causing us trouble when we Paste forms into the production database is that when we delete the old form, the local replica sees that, and deletes it’s local copy, as it should. When we then replace the production design, the copy is deleted, and the original is “reactivated”. The problem is that when this reactivation happens on the server, Notes decrements the document’s sequence number. (I don’t know why).

This causes the local replica to ignore the reactivated form, since it’s sequence number for that document is greater than the server copy. Here’s an example.

Action

Template database

Server Database

Local Replica

Notes

Starting situation.

Original Form, sequence = 9

Original Form, sequence = 4

Original Form, sequence = 4

The Template version has been saved 9 times, but has only been Replaced in the server copy 4 times.

The form is changed.

Server copy is Replaced.

Local replicates.

Original Form, sequence = 10

Original Form, sequence = 5

Original Form, sequence = 5

As expected

The form is changed.

It’s Cut-n-pasted into the server copy, and the one that was there is deleted.

Local replicates.

Original Form, sequence = 11

Original Form, sequence = 6,

Marked as deleted

New Form, sequence = 2

Original Form, sequence = 6,

Marked as deleted

New Form, sequence = 2

The old form still exists as a Deletion Stub, and a new document is created by the Paste action.

The form is changed.

Server copy is Replaced.

Local replicates.

Original Form, sequence = 12

Original Form, sequence = 5,

Reactivated

New Form, sequence = 3,

Marked as deleted

Original Form, sequence = 6,

Marked as deleted

New Form, sequence = 3,

Marked as deleted

Note that when the server reactivated the original document, the sequence was decremented. Thus, it’s NOT copied over by the replication.

So the solution to the problem is to increment the sequence number on the server copy. I would suggest that you open the form in the designer, and just to be safe, save it 5 times or so. That should increment the sequence number past the value that the local replicas remembers, and so the Original form will be copied back to the local replica.

The reason that a Cut and Paste will not work, and would probably re-cause the problem is this.

The TEST system has an IE form with a particular Universal Notes ID in it. (The “AC86DC19C9125EDE8525682C005EDB59”)

When we do a Design Refresh, this number is carried over into the Production System, and then down to the Replicas.

If, in the production system, you Copy the form, delete the old one, and paste it back in, you are deleting “AC86…” and creating a new document, say “FFAA…”. When someone replicates, this is carried down to the replica.

So now in the Production and Replica system, we have AC86… as a deletion stub, which was the original IE form, and FFAA… as the new IE form. At this point, everything still works.

Now we do a design refresh. The system sees that there is a form in the TEST system, called IE, with a code of AC86… and a different IE form in the production system called FFAA… It assumes that the TEST system is correct (as it is the “master” copy) and so deletes the FFAA… form, and copies back in the AC86… form. So now the original is back, and the pasted version is deleted.

The problem comes in when we replicate. The replication process sees FFAA… as being deleted, and so deletes the same form in the local copy. It then looks at the AC86… documents, and sees the Sequence number in the Replica is greater then the Sequence number in the Server copy, and so assumes that the Replica is more recent, and thus “correct”.

And it’s just hit me that if you or I replicate back (having designer access) the replication process is going to delete the SERVER copy of AC86… and then the Production copy is now broken (Very Nasty).

So the bottom line is : Don’t paste into the Server copy. Always do a Design replace from the Test system, and so keep the original Universal Note IDs the same in the Production and Replica copies.