Have not found a resolution yet.
In case it helps anyone else, Epicor Support responded with:
The Regen problem you are having is addressed in the following KnowledgeBase page:
KB0029531 Getting .NET errors that cause Regen to fail - Doing a Data Model Regen, getting .NET errors and it stops.
Resolution
EVALUATION:
There could be several reasons for this error:
- Bad characters in the field name.
- An index could be missing from a base table.
- Possible manually added a schema outside of Epicor to tables that were created outside of Epicor also.
RESOLUTION:
For issue # 1
In Extended UD Table Maintenance, locate and remove any EXUD fields which has a special character in the field name (#, !, &, $, etc.) then rebuild the data model.
Use Attached SQL Script (QueryToFindSpecialCharactersInUDTables.sql) that can be used to search/find any EXUD fields that contains a Special Character.
For issue #2
Use this script to find the table without an index (NOTE- some tables have no index because they are for example, conversion tables):
SELECT SCHEMA_NAME(schema_id) AS SchemaName,name AS TableName
FROM sys.tables
WHERE OBJECTPROPERTY(OBJECT_ID,‘TableHasPrimaryKey’) = 0
ORDER BY SchemaName, TableName;
GO
If you find a table that is a base table without an index then you can run a script SIMILAR TO THIS ONE (this one is for the PartCost table):
ALTER TABLE [Erp].[PartCost] ADD CONSTRAINT [PK_PartCost] PRIMARY KEY CLUSTERED
(
[Company] ASC,
[PartNum] ASC,
[CostID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = OFF) ON [PRIMARY]
GO
For issue #3 Identify and then remove the “foreign” schema. The Regen should work fine after that.
QueryToFindSpecialCharactersInUDTables.txt (1.7 KB)