My co-worker, Virginia Tauss, just ran across the most annoying thing in an “Old Notes” database. The database has a number of Shared Actions, some of which are used on forms and views that are inherited explicitly from one of our templates. In our system, each of the projects we support gets a database to manage their project, built off a base design, then modified to meet their needs. Thus, the database does not inherit it’s entire design from the template. In fact, there are some design elements that are drawn from a second template (our Field Operations Manual has several forms and views that are used in all databases).
In my recent design changes, I started using Shared Actions in the Field Operations Manual design, for all the reasons everyone likes Shared Actions – code reusability, simplicity and space savings.
Unfortunately, when a form or view inherited from the Field Operations Manual uses a Shared Action, the inheriting database would not display the same action as had been designated in the template.
Shared Actions rely upon something called a ‘share-id’, which has nothing to do with the name of the action, the order in which it appears in the list of actions in the database or the Note ID of the design element. That is to say, unique to each implementation, rendering Shared Actions far less useful in our multi-template inheritance environment.
This issue is related to how Shared Actions are referenced. They are not referenced by Note ID, by name, or by their order in the Shared Actions list. They are referenced by a property called ‘share-id’. If a Shared Action is copied to another database the share-id for the action is not necessarily preserved. The issue typically occurs after a design element is updated and the design of the database is refreshed.
Needless to say, this was an eye-opener. I’d never had databases using multiple templates before and hadn’t a lot of experience with Shared Actions in templates. One of my friends, Greg Ehrig, was a ski instructor at one point and he always said, “If you aren’t falling down, you aren’t learning.” Notes and XPages give us all plenty of chances to fall down, so plenty of chances to learn!