Sage CRM - You may need to create views manually

    
 
Sage CRM You May Need to Create Views Manually
Why does it appear? 

The can be several reasons why this message appears and it usually comes when there has been a change in the configuration of the system. This maybe as a result of an upgrade, or if the SQL password for the "sa" user has been changed, and the same change has not been affected in CRM. 

There are some helpful questions to ask when this happens. 

Does the error appear for all users? 

If the system administrator can logon but another user can not, you will have to turn on the system logs and see what happens. Start looking at the SQL logs and see if the requests are getting to the database. It may give you enough information to sort out the problem. 

Is your database running? 

UnableToConnectToDB 
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied 
Driver: MSSQL 
Server: UKTRAINING 
Database: CRM 
LoginName: sa You may need to recreate views manually. 

This is symptomatic of a database server that is not running. Can you connect using query analyser or other SQL tool? 

If the database is already running.. stop and start the database service and retry. 

Have you just restored a backedup database? 

The error message can appear when you have a mismatch between database and CRM versions. For example you may get the message if you have restored a Sage CRM 5.8 database to an install of Sage CRM that is 6.0 

Is CRM trying to connect to the correct database? 

Go to start\run\regedit\HKEY_LOCAL_MACHINE\SOFTWARE\eware\config click on the CRM beneath that and see the right panel see that default databaseserver name is exactly you have, if it is not, then change it manually. You'll need to do an IISRESET before you try and logon again. 

Have you changed the database password? 

UnableToConnectToDB 
Login failed for user 'sa' 
Driver: MSSQL 
Server: UKTRAINING 
Database: CRM 
LoginName: sa You may need to recreate views manually. 

This can be symptomatic of when the "sa" password was entered correctly but contains a special character, such as $, in the beginning. 

Or more alarmingly it can be symptomatic of someone or something (e.g. a Virus, worm etc) changing the password on the database server. 

Note:
If you need to change the "sa" password, the correct thing to do is to logon to CRM, change the database password under Administration>System>Database first, then reset the password in MSSQL, and finally reset IIS and logon to CRM again. 

But if the database "sa" password has been reset first, then it will not be known to CRM, so you will not be able to connect to the database. Then you'll need to reset the password in MS SQL to the previous password. 

But what if you don't know the database "sa" password? You will first need to reset the "sa" password to something you do know. Then you will have to reset the password in the CRM registry. (Backup the registry before doing this!!!). 

In the registry browse to HKEY_LOCAL_MACHINE | SOFTWARE | eWare | Config | [CRM], where [CRM] is the name of the CRM instance. 

You can set the DatabasePassword to the new database password in plain text. Do an IISRESET, then you should be able to logon to CRM. Once you have logged on to CRM go and reenter the new password and it will be saved back into the registry in encrypted form. 

But how do I recreate views manually? 

There is a view in the Sage CRM database called "vsentinel". When CRM first starts up (after an IISRESET) and it finds that vsentinel is not present, it will use this as the trigger to force the recreation of the views based on the definitions stored in meta data. Once the other views have been recreated it then creates the trigger view "vsentinel" again. 

To force the recreation of the views do this: 

1. Do IISRESET from the Run prompt. 
2. Go to the SQL Manager. Take a backup of your CRM SQL Database first. 
3. Now through SQL Manager itself, select the CRM SQL Database instance. There you will find an option Views which lists all the Views against it. 
4. Select the user view "vsentinel". All CRM views are prefixed with ‘v’. 
5. Press the Delete key from the keyboard and drop the view. 
6. After the IISRESET, try to login to CRM and see whether you are able to log in to CRM now or not.
 
Have you been editing the Themes CSS files in Sage CRM 6.2?
 
Sage CRM 6.2 has introduced a new way of generating this message.  This can seem surprising as it has nothing to do with the database and everything to do with a corrupt CSS file being in the Themes folder.
 
Sage CRM 6.2 introduced the idea of themes.  There is some training material that covers this within the Resources section of this website that development partners can download and there are also additional sample themes available.
 
As part of developing a theme a cascading stylesheet will have to be created and edited that contains the style settings for the new look and feel that is being constructed.  But there is a section of the stylesheet that has to be preserved.  This is clearly marked in the existing stylesheets.
 
e.g.
 
C:\Program Files\Sage\CRM\CRM\WWWRoot\Themes\default.css
C:\Program Files\Sage\CRM\CRM\WWWRoot\Themes\neutral.css
C:\Program Files\Sage\CRM\CRM\WWWRoot\Themes\sage_green.css
 
/* 
  CRM GREEN CUSTOM SETTINGS 
  DO NOT CHANGE FORMAT BETWEEN 'CRM SETTINGS' TAGS
  [CRM SETTINGS]
    [INITIALIZATION]
      //theme file version
      VERSION = 1.0
    [COLORS DEFINITION]
      //wsEmailclient
      COLORCAPTIONBLUE=#6795C3
      //TSearchEntryGroup.GetEditHtmlFromContent
...
    [FONTS]
      //WrbTriPage, WsEmailClient
      FONTFAMILY=MS P-Mincho
...
  [CRM SETTINGS]
*/
The values within this section maybe changed BUT the structure must be preserved.  If this section is corrupted or is absent in any css file contained in the Themes folder
 
C:\Program Files\Sage\CRM\CRM\WWWRoot\Themes\
 
then it will generate the 'You may need to recreate views manually' message when someone tries to first logon after IIS has been reset.  It does not matter is the CSS file is not referenced in translations. All CSS files in the folder are scanned.  The origin of the error may be shown in the system log in this case.

So what happens if I still can't log on

Remember this was not an exhaustive article. Don't panic. Think about what has just changed in the system? Have you applied a new component? Can you restore to the prior state? Have a good look through the forums and knowledge base and then log a case with support. 

I hope that this article has helped.
BAASS Author

About The Author

BAASS Author

BAASS Business Solutions customer-centric, collaborative approach has enabled us to expand our team and office locations throughout the years. BAASS has over 20 locations throughout Canada, the US and Caribbean. Our success has been built on a simple formula - deliver what we promise and build long-term win-win relationships.