Summary:

A customer may delete the Lead Company screen, and wish to restore it.

Symptoms:

Screens are hard-deleted when removed from CRM. There is no option for restoring screens within CRM when they are deleted. The screen will need to be restored directly on the database (if you have access to it). If you are a Cloud customer, contact your support representative quoting this article number.

Work around / Resolution:

The following should restore the screen:

WARNING: Modification of CRM objects made other than through the CRM interface are not covered under the terms of your support agreement. Any changes made outside of the CRM interface can have unpredictable results and are not recommended. Should assistance be required to correct changes made in this manner, this may be chargeable at normal consultancy rates. Please ensure that you have a full backup of your application and database before making any changes to your CRM database. The techniques or examples contained in this email are for illustrative purposes only, and have not been tested in a production environment.

-- Restores LeadCompanyScreen if deleted

declare @cobjId int
declare @seapId int
declare @leadTableId int
declare @colpId int
declare @contId int
declare @contCobjId int

select @leadTableId = bord_tableid from custom_tables where bord_name = N'Lead'
exec @cobjId = eware_get_Identity_Id @Table_Name = 'Custom_ScreenObjects'
insert into Custom_ScreenObjects (CObj_TableId, CObj_Name, CObj_Type, CObj_EntityName, CObj_AllowDelete,
CObj_CreatedBy, CObj_CreatedDate, CObj_UpdatedBy, CObj_UpdatedDate, CObj_TimeStamp, CObj_CustomTableIDFK)
values (@cobjId, 'LeadCompanyScreen', 'Screen', 'Lead', 'Y', -1, GETDATE(), -1, GETDATE(), GETDATE(), @leadTableId)

exec @seapId = eware_get_Identity_Id @Table_Name = 'Custom_Screens'
select @colpId = ColP_ColPropsId from Custom_Edits where ColP_ColName = N'lead_companyemployees' and ColP_Entity = N'Lead'
insert into Custom_Screens (SeaP_SearchEntryPropsId, SeaP_SearchBoxName, SeaP_Order, SeaP_ColName, SeaP_Newline,
SeaP_RowSpan, SeaP_ColSpan, SeaP_CreatedBy, SeaP_CreatedDate, SeaP_UpdatedBy, SeaP_UpdatedDate, SeaP_TimeStamp,
SeaP_CustomEditsIDFK, SeaP_ScreenObjectsIDFK)
values (@seapId, 'LeadCompanyScreen', 5, 'lead_companyemployees', 0, 0, 0, -1, GETDATE(), -1, GETDATE(), GETDATE(), @colpId, @cobjId)

exec @seapId = eware_get_Identity_Id @Table_Name = 'Custom_Screens'
select @colpId = ColP_ColPropsId from Custom_Edits where ColP_ColName = N'lead_companyindustry' and ColP_Entity = N'Lead'
insert into Custom_Screens (SeaP_SearchEntryPropsId, SeaP_SearchBoxName, SeaP_Order, SeaP_ColName, SeaP_Newline,
SeaP_RowSpan, SeaP_ColSpan, SeaP_CreatedBy, SeaP_CreatedDate, SeaP_UpdatedBy, SeaP_UpdatedDate, SeaP_TimeStamp,
SeaP_CustomEditsIDFK, SeaP_ScreenObjectsIDFK)
values (@seapId, 'LeadCompanyScreen', 3, 'lead_companyindustry', 0, 0, 0, -1, GETDATE(), -1, GETDATE(), GETDATE(), @colpId, @cobjId)

exec @seapId = eware_get_Identity_Id @Table_Name = 'Custom_Screens'
select @colpId = ColP_ColPropsId from Custom_Edits where ColP_ColName = N'lead_companyname' and ColP_Entity = N'Lead'
insert into Custom_Screens (SeaP_SearchEntryPropsId, SeaP_SearchBoxName, SeaP_Order, SeaP_ColName, SeaP_Newline,
SeaP_RowSpan, SeaP_ColSpan, SeaP_CreatedBy, SeaP_CreatedDate, SeaP_UpdatedBy, SeaP_UpdatedDate, SeaP_TimeStamp,
SeaP_CustomEditsIDFK, SeaP_ScreenObjectsIDFK)
values (@seapId, 'LeadCompanyScreen', 1, 'lead_companyname', 0, 0, 0, -1, GETDATE(), -1, GETDATE(), GETDATE(), @colpId, @cobjId)

exec @seapId = eware_get_Identity_Id @Table_Name = 'Custom_Screens'
select @colpId = ColP_ColPropsId from Custom_Edits where ColP_ColName = N'lead_companyname' and ColP_Entity = N'Lead'
insert into Custom_Screens (SeaP_SearchEntryPropsId, SeaP_SearchBoxName, SeaP_Order, SeaP_ColName, SeaP_Newline, SeaP_RowSpan,
SeaP_ColSpan, SeaP_CreatedBy, SeaP_CreatedDate, SeaP_UpdatedBy, SeaP_UpdatedDate, SeaP_TimeStamp, Seap_DeviceID,
SeaP_CustomEditsIDFK, SeaP_ScreenObjectsIDFK)
values (@seapId, 'LeadCompanyScreen', 1, 'lead_companyname', 0, 1, 1, -1, GETDATE(), -1, GETDATE(), GETDATE(), 2, @colpId, @cobjId)

exec @seapId = eware_get_Identity_Id @Table_Name = 'Custom_Screens'
select @colpId = ColP_ColPropsId from Custom_Edits where ColP_ColName = N'lead_companyrevenue' and ColP_Entity = N'Lead'
insert into Custom_Screens (SeaP_SearchEntryPropsId, SeaP_SearchBoxName, SeaP_Order, SeaP_ColName, SeaP_Newline,
SeaP_RowSpan, SeaP_ColSpan, SeaP_CreatedBy, SeaP_CreatedDate, SeaP_UpdatedBy, SeaP_UpdatedDate, SeaP_TimeStamp,
SeaP_CustomEditsIDFK, SeaP_ScreenObjectsIDFK)
values (@seapId, 'LeadCompanyScreen', 4, 'lead_companyrevenue', 0, 0, 0, -1, GETDATE(), -1, GETDATE(), GETDATE(), @colpId, @cobjId)

exec @seapId = eware_get_Identity_Id @Table_Name = 'Custom_Screens'
select @colpId = ColP_ColPropsId from Custom_Edits where ColP_ColName = N'lead_companywebsite' and ColP_Entity = N'Lead'
insert into Custom_Screens (SeaP_SearchEntryPropsId, SeaP_SearchBoxName, SeaP_Order, SeaP_ColName, SeaP_Newline,
SeaP_RowSpan, SeaP_ColSpan, SeaP_CreatedBy, SeaP_CreatedDate, SeaP_UpdatedBy, SeaP_UpdatedDate, SeaP_TimeStamp,
SeaP_CustomEditsIDFK, SeaP_ScreenObjectsIDFK)
values (@seapId, 'LeadCompanyScreen', 2, 'lead_companywebsite', 0, 0, 0, -1, GETDATE(), -1, GETDATE(), GETDATE(), @colpId, @cobjId)

exec @seapId = eware_get_Identity_Id @Table_Name = 'Custom_Screens'
select @colpId = ColP_ColPropsId from Custom_Edits where ColP_ColName = N'lead_companywebsite' and ColP_Entity = N'Lead'
insert into Custom_Screens (SeaP_SearchEntryPropsId, SeaP_SearchBoxName, SeaP_Order, SeaP_ColName, SeaP_Newline, SeaP_RowSpan,
SeaP_ColSpan, SeaP_CreatedBy, SeaP_CreatedDate, SeaP_UpdatedBy, SeaP_UpdatedDate, SeaP_TimeStamp, Seap_DeviceID,
SeaP_CustomEditsIDFK, SeaP_ScreenObjectsIDFK)
values (@seapId, 'LeadCompanyScreen', 2, 'lead_companywebsite', 1, 1, 1, -1, GETDATE(), -1, GETDATE(), GETDATE(), 2, @colpId, @cobjId)

select @contCobjId = CObj_TableId from Custom_ScreenObjects where CObj_Name = N'LeadEntryBlock' and CObj_Type = N'Block' and CObj_EntityName = N'Lead'
exec @contId = eware_get_Identity_Id @Table_Name = 'Custom_ContainerItems'
insert into Custom_ContainerItems (Cont_ContainerItemId, Cont_ContainerName, Cont_BlockName, Cont_Order, Cont_NewLine,
Cont_CreatedBy, Cont_CreatedDate, Cont_UpdatedBy, Cont_UpdatedDate, Cont_TimeStamp,
Cont_Custom_ScreenObjectsID, Cont_ScreenObjectChildIDFK)
values (@contId, 'LeadEntryBlock', 'LeadCompanyScreen', 2, 0, -1, GETDATE(), -1, GETDATE(), GETDATE(), @contCobjId, @cobjId)

drop view vSentinel
-- Refresh your metadata to complete

You'll need to refresh your metadata afterwards in order for the screen to appear.