I needed to add a database script to a database template which had none. To my surprise, when I tried to open the empty element in Designer, it displayed the error “Invalid or nonexistent document”. I tried various things but only got results by doing the following:
Backup up the template that you want to fix, in case of any problem.
Make a replica of the template “LO.ntf” on Local.
Temporarily disable replication on LO.ntf (In Replication Settings)
Make a new COPY of LO.ntf on Local, “LOCO.NTF”.
Close Notes, Designer, etc.
In a Command Prompt,
nCompact loco.ntf -C-D
start Notes
Edit the Database Script - just put in an Option Declare for now.
Set LOCO.ntf to BE the Master Template “TEMP_LOCO” in Database Properties - Design tab.
Set LO.ntf to inherit FROM the Master Template “TEMP_LOCO” in Database Properties - Design tab.
Refresh the design of LO.ntf (from template server Local of course).
Clear the setting of LO.ntf so that it NO LONGER inherits from the Master Template “TEMP_LOCO” in Database Properties - Design tab.
Re-enable replication of LO.ntf.
Replicate LO.ntf
The template on the server should now behave properly when you edit the database script.
Delete LO.ntf and LOCO.ntf .