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)
- Request the individual CST files you need from Spitfire Support.
- Run Microsoft Dynamics as an Windows Administrator (elevated, not DSL login)
- 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.
- Example 1: DELETE FROM dbo.CustomVBA WHERE ScreenId = ‘0325000‘.
- Example 2:DELETE FROM dbo.CustomVBA WHERE ScreenId = ‘0325000‘ and (Entityid = ‘SPITFIRE‘ or Description like ‘sfPMS%‘)
In Microsoft Dynamics SL
- Run the Import Customization tool – 91.510 and import the specific CST from Spitfire (this creates a “one group” customization).
- Double Click on Self (in the bottom status area)
- Choose One Group.
- Check Exclude Event Code.
- Open the screen (perhaps AP Document Maintenance – 03.250)
- Press ALT+CTRL+C.
- Press F7 to open VBA.
- Choose Tools | References.
- Note if “Customization Module for Spitfire Software…” does not appear or is not checked.
- Click in list box (be careful not to check or uncheck anything).
- Type D.
- Look up the list and check “Customization Module for Spitfire Software….”
- Click OK.
- Click Save.
- Close VBA.
- Close the DSL screen.
- Double-click on ONE GROUP ( in the bottom status area).
- Uncheck Exclude Event Code.
- Select the Self radio button.
- Click OK.
- Test your Customization.
You can review the customization level in the field “Sequence”
- 100 is Supplimental
- 300 is All User
- 350 is One Group
- Run a SQL Script to change the sequence
SET EntityID = ‘Spitfire’, Sequence = 350
WHERE ScreenId = ‘0325000‘ and Description LIKE ‘SFPMS%‘
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: December 16, 2019 at 18:40 pm