back to top

Adding Missing DB Columns to the SECTABLEDEFS Table in Infor CRM (Formerly Saleslogix)

Here is a SQL script I came up with to add any fields that exist in a Infor CRM enabled table (it exists in the REYNCTABLEDEFS table) but that are not correctly defined in the SECTABLEDEFS table.  This type of thing usually happens if someone adds a new database field outside of the Infor CRM tools, like using the SQL Management studio wizards, or a SQL script directly.

Boiler plate warning:  Running SQL on your database without knowing what you are doing can cause all kinds of bad things.  Run these scripts only if you understand what they are doing.  ALWAYS RUN THIS TYPE OF THING IN A TEST SYSTEM FIRST!

 

--Finds columns in tables that exist in RESYNCTABLEDEFS but are not
--properly defined in the SECTABLEDEFS.
select
db.tablename tablename,
db.fieldname fieldname
from
(select a.name tablename, b.name fieldname, b.xusertype from sysobjects a inner join syscolumns b on a.id=b.id where a.xtype='U') db
left join
sysdba.sectabledefs b on db.tablename=b.tablename and db.fieldname=b.fieldname
inner join
sysdba.RESYNCTABLEDEFS c on db.tablename=c.TABLENAME
where
b.FIELDNAME is null


--This script actually fixes the SECTABLEDEFS so any real DB columns not in the SECTABLEDEF
--are created.  This assumes any DateTime data type should be set to store in UTC format.
declare @maxoffset int
declare @maxindex int
set @maxindex = (select MAX(fieldindex) from sysdba.SECTABLEDEFS)
set @maxoffset = (select MAX(fieldoffset) from sysdba.SECTABLEDEFS)


insert into sysdba.SECTABLEDEFS
(TABLENAME, FIELDNAME, FIELDOFFSET, FIELDINDEX, SEQCODE, KEYFLAG, SYNC, USERDEF, DISPLAYNAME, ISHIDDEN,
DATETIMETYPE, DESCRIPTION, AUTOINCREMENT, MODIFYDATE, MODIFYUSER, CREATEDATE, CREATEUSER)
select
upper(db.tablename) tablename,
upper(db.fieldname) fieldname,
case when c.SECURE='T' then @maxoffset + ROW_NUMBER() over(order by db.tablename, db.fieldname)
else 0 end fieldoffset,
@maxindex + ROW_NUMBER() over(order by db.tablename, db.fieldname) fieldindex,
'2' SEQCODE,
'0' keyflag,
'Y' sync,
'T' userdef,
db.fieldname Displayname,
'F' isHidden,
case when t.name='datetime' then 'U'
else null end datetimetype,
null description,
'F' autoincrement,
GETUTCDATE() modifydate,
'ADMIN' modifyuser,
GETUTCDATE() createdate,
'ADMIN' createuser
from
(select a.name tablename, b.name fieldname, b.xusertype from sysobjects a inner join syscolumns b on a.id=b.id where a.xtype='U') db
left join
sysdba.sectabledefs b on db.tablename=b.tablename and db.fieldname=b.fieldname
inner join
sysdba.RESYNCTABLEDEFS c on db.tablename=c.TABLENAME
left JOIN
sys.types AS t ON db.xusertype=t.user_type_id
where
b.FIELDNAME is null
Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos