Adding Fields, Deleting Fields, Views, vSentinel and SQL Errors

1 minute read time.

Sage CRM provides the system administrator with easy ways to add or remove fields from the system.

But when you add or remove a field then you will implicity affect views which are based on those tables. And of course views may inturn be based on views. Each of these views in turn are referenced by CRM for the implementation of security policies. Every screen and list in CRM draws its data from views. So there is a ripple effect when a field is added or dropped from the system.

To drive the rechecking and validation of the views, the special view 'vSentinel' is dropped when a field is added.

Dropping the vSentinel prompts the system to drop and recreate all the other views defined within the custom_views metadata table. The recreation of the views ensures that all the new fields are available within all the existing views. There is no existing quick and easy way of checking to see which views are linked either implicitly or explicitly. If the views were not dropped and recreated automatically the Administrator would need to go in and manually alter the views that contain joins to the table that have just been changed.

The process is fairly resource intensive that impacts system performance. Even a moderately customized system can easily contain several hundred views. And dropping and recreating will take seconds.

Lesson Learnt

Adding a single field will ripple through the system. A user may request a page just as the view the list is based on is dropped. The drop and recreate will only take a second but the user may still get an 'unreproducable error'. So while users are logged on to the system then it is best not to be changing the data model by adding or removing fields.

Other Reading

vSentinel has been mentioned in these articles

Views have been discussed in many previous articles.