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)
Procedure:
Preparation
- 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). Important: if you get a “Permission Denied” error from Dynamics SL, STOP: review the Dynamics SL user’s permissions until they can perform this step!
- Choose the customization level, for example One Group. (See “In SQL” section below for help with customization level numbers and names).
- 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 the customization level in the bottom status area (for example ALL USERS or ONE GROUP).
- Uncheck Exclude Event Code.
- Select the Self radio button.
- Click OK.
- Test your Customization.
- Close Dynamics SL entirely, reopen as regular user
In SQL
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
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: April 23, 2024 at 8:36 am