Thursday, August 27, 2009

HEAT: Creating Detail Screens with SQL

A client recently asked: Is there a way to change a call type without recreating the detail screen?

No, when a call type is changed, the associated detail screen must be recreated. This is not particularly easy using Administrator. You can copy and paste the form but the fields do not come over so they must be added manually.

If, however, you are handy with SQL and have a test environment to use, you can try the following SQL code to recreate a detail form using the SQL backend database.

A word of caution: this method is not supported by FRS so make sure you have a good backup first (haf file, sql backup). Also, it is recommended that you test it on a development server first.

However, if this works for you, it can save hundreds of hours if you have a number of detail forms to recreate. The SQL code is below:

/* Select * from HEATTbl where TableName = 'Detail' and TableType = 'Northgate housing' */
Update HEATTbl set TableType = '*new call type*' where TableName = 'Detail' and TableType = '*old call type*'

/* Select * from HEATFld where TableName = 'Detail' and TableType = 'Northgate Housing' */
Update HEATFld set TableType = '*new call type*' where TableName = 'Detail' and TableType = '*old call type*'

/* Select * from HEATCtrl where TableName = 'Detail' and TableType = 'Sales Order' */
Update HEATCtrl set TableType = '*new call type*' where TableName = 'Detail' and TableType = '*old call type*'

/* Select * from HEATForm where TableName = 'Detail' and TableType = 'Sales Order' */
Update HEATForm set TableType = '*new call type*' where TableName = 'Detail' and TableType = '*old call type*'

Note: You need to rebuild the catalog file for the clients so commit an edit set when you do this.

No comments: