SQL Error while trying to add column in company grid

By | August 14, 2015

Hi folks! As we all know that CRM contains large number of screens, lists, grids, etc. CRM has respective tables to maintain the same. Through these blog/article I will explain you a scenario which I faced while working in one of the project and how I resolved a very strange issue.
Related Stuff: Quick look on Sage CRM tables
While adding columns in “Company Grid” crm prompted me an SQL error. Then I checked the SQL log file and found   “The INSERT statement conflicted with the FOREIGN KEY constraint “FK_CustomLists_ScreenObjects”. The conflict occurred in database “CISPL”, table “dbo.Custom_ScreenObjects”, column ‘CObj_TableId’.”   these error message. To get clear idea about these issue I checked the entries made by crm in “Custom_ScreenObjects” table in another same version CRM database by executing below mentioned select query.” select * from Custom_ScreenObjects where cobj_entityname=’company’ and cobj_type=’list’” Found  entry for “Company Grid” was missing. Please find below screen shot.
To get rid of above problem I manually inserted the missing Company Grid in above table with the help of insert query. Finally issue got resolved. See below screen shot for your reference.Img2
After performing above steps please give “Metadata refresh”. Hope my above explanation helps!
Also Read:
1) How to Visible Standard Field in List
2) Codeless customizations to add List Blocks
3) Highlight All Grid Rows in Sage CRM v7.3
4) Enable Keyword Search on Sage CRM Find screen
5) Easiest way to create workflow component