KBA-01635: Dynamics SL CST files not opening

Purpose & Scope:

Microsoft Dynamics SL customizations are not opening, and VBA Code appears with the message: Compile Error: User-defined type not defined. (See the screen shot in Additional Comments.)

Or, the screen opens and displays the message “Attempting to set text control to an invalid value.  Value violates the Mask length.”  (System Message 6938)



  1. Request the individual CST files you need from Spitfire Support.
  2. Run Microsoft Dynamics as an Windows Administrator (elevated, not DSL login)
  3. In SQL Management Studio, remove any prior customizations. One way to do this indiscriminately is using the command below (which uses screen 03.250.00 as an example).
    Note: Make note of the Sequence Level of this customization.

    1. Example 1: DELETE FROM dbo.CustomVBA WHERE ScreenId = ‘0325000.
    2. Example 2:DELETE FROM dbo.CustomVBA WHERE ScreenId = ‘0325000‘ and (Entityid = ‘SPITFIRE‘ or Description like ‘sfPMS%‘)

In Microsoft Dynamics SL

  1. Run the Import Customization tool – 91.510 and import the specific CST from Spitfire (this creates a “one group” customization).
  2. Double Click on Self (in the bottom status area)
  3. Choose the customization level, for example One Group.  (See “In SQL” section below for help with customization level numbers and names).
  4. Check Exclude Event Code.
  5. Open the screen (perhaps AP Document Maintenance – 03.250)
  6. Press ALT+CTRL+C.
  7. Press F7 to open VBA.
  8. Choose Tools | References.
  9. Note if “Customization Module for Spitfire Software…” does not appear or is not checked.
  10. Click in list box (be careful not to check or uncheck anything).
  11. Type D.
  12. Look up the list and check “Customization Module for Spitfire Software….”
  13. Click OK.
  14. Click Save.
  15. Close VBA.
  16. Close the DSL screen.
  17. Double-click on the customization level in the bottom status area (for example ALL USERS or ONE GROUP).
  18. Uncheck Exclude Event Code.
  19. Select the Self radio button.
  20. Click OK.
  21. Test your Customization.


You can review the customization level in the field “Sequence”

  • 100 is Supplimental
  • 300  is All User
  • 350 is One Group
  1. Run a SQL Script to change the sequence
    UPDATE dbo.CustomVBA.
    SET EntityID = ‘Spitfire’, Sequence = 350
    WHERE ScreenId = ‘0325000‘ and Description LIKE ‘SFPMS%

Additional Comments:

Note that the INI option [Customization] VBASourceCompile=Yes in C:\Program Files (x86)\Microsoft Dynamics\SL\Applications\solomon.ini as described in DSL KB 2001541 is known to cause this error with no known workaround.  Do not use this option!

The error looks like this:


KBA-016035; Last updated: June 1, 2022 at 16:34 pm