Developer Tip: Creating a Microsoft Dynamics GP Chunk File
Updated: February 17, 2005
By David Musgrave

This tip shows you how to use Dexterity to create a Chunk (.cnk) file. A Chunk file is a self-installing data dictionary file that, once installed, will create a dictionary executed by the Dexterity runtime. A Chunk file is used to distribute customizations and third-party products to a customer’s site. These customizations can seamlessly add functionality to Microsoft Dynamics GP or modify existing functionality in the application.
What Is Dexterity?
For those of you not familiar with Dexterity, Microsoft originally designed this tool to enable developers to create the Microsoft Dynamics GP solutions. Dexterity is ideal for creating transaction-based business applications, such as accounting and business management products. By using Dexterity to create applications that integrate with Microsoft Dynamics GP Professional, Microsoft Dynamics GP Standard, and Microsoft Business Solutions Small Business Financials North America Edition, you can build more powerful solutions tailored to the industries in which you have expertise.
In addition, Dexterity provides you with the complete set of components used to create Microsoft Dynamics GP Professional, Microsoft Dynamics GP Standard, and Microsoft Small Business Financials, including a forms builder, a database manager, a report builder, a 4GL scripting language and debugger, and an embedded macro system.
You'll use the Dexterity IDE (Integrated Development Environment) to create, debug, and test your customization. When you are ready to distribute your customization, you will use Dexterity Utilities to perform the steps to create the Chunk file. Dexterity Utilities can also perform a number of maintenance and reporting functions not normally needed during the development cycle.
The Dictionaries You'll Use
In this tip, you’ll also work with two dictionaries: the Development Dictionary and an Extracted Dictionary. The Development Dictionary is a renamed copy of the DYNAMICS.DIC file that also contains all the added or modified resources and code you have developed.
An Extracted Dictionary is a dictionary that contains only the added or modified resources and code you’ve developed. It does not contain the rest of the DYNAMICS.DIC dictionary. An Extracted Dictionary is named for the fact that all its added forms, reports, and code are extracted from the Development Dictionary.
The Extracted Dictionary will also contain any modified forms and reports, which are transferred from the Development Dictionary. Modified forms and reports will become alternate forms and reports once the Chunk file is installed. The Chunk file itself is actually built from this Extracted Dictionary, which is created during the process described below.
Getting Down to Business
Before creating the Chunk file, with your Development Dictionary open, you should Compile All by using the Toolbar button or the menu choice (Explorer -> Compile All) from within Dexterity. If you are using source code control (which is recommended), select Explorer -> Source Code -> Check In to ensure all resources are checked in. You should also select Explorer -> Source Code -> Update Index File to ensure that the IDs assigned to resources you create do not change values between builds. Close Dexterity when you are done.
I recommend that you use a macro to record the following set of steps. That way, you can replay the macro to re-create the Chunk file at any time.
To create a Chunk file, open Dexterity Utilities and perform the following steps:
1. | Open the source dictionary using the Development Dictionary (File -> Open Source Dictionary). |
2. | From the Toolbar, select Utilities -> Extract to extract all resources with resource IDs greater than 22,000 (in other words, all third-party resources) into an Extracted Dictionary. |
3. | If you do not have any alternate forms and/or reports, skip to step 7. (Alternate forms and reports are original Microsoft Dynamics GP forms and reports that have been modified in your customization. Because their resource IDs are less than 22,000, they are not extracted with step 2. Therefore, moving alternate forms and reports to your Chunk file requires additional steps. |
4. | Open the destination dictionary using the Extracted Dictionary you created in step 2 (File -> Open Destination Dictionary). |
5. | From the Toolbar, use Transfer -> Dictionary Module to transfer any alternate forms and/or reports into the Extracted Dictionary. |
6. | Close the destination dictionary (File -> Close Destination Dictionary). |
7. | Close the source dictionary (File -> Close Source Dictionary). |
8. | Open the editable dictionary by using the Extracted Dictionary created in step 2 (File -> Open Editable Dictionary). |
9. | If you do not have any alternate forms and/or reports, skip to step 11. |
10. | From the Toolbar, go to Resources -> Series Resources. Check both the All Resource Types and All Series check boxes, and click Update. This will update the internal series resources lists to include the alternate forms and/or reports. |
11. | From the Toolbar, select Utilities -> Product Information. Enter the Product Name, Product ID (assigned to you by Microsoft Sales Operations in Fargo, North Dakota, United States), the names of the custom forms and reports dictionaries, and the compatibility information. Then click OK. Make sure the Set file is DYNAMICS.SET and the Dictionary is set to 0. Note: To request a unique Product ID, either e-mail mbsorder@microsoft.com or create a service request from PartnerSource -> Pricing & Ordering -> New Service Request (this way you get an assigned incident number). Note that PartnerSource is a subscription service. In either case, you need to include your Authorized Phone Number or Account Number as well as the name and short description of your product. |
12. | Select Utilities -> Auto Chunk. Then use the Browse button to select the filename of the Chunk Dictionary; use an8.3 format filename with the extension .cnk. Next select a module (I usually use 51, which was labeled as Dexterity in older versions), and enter your major, minor, and build numbers. I normally match my major and minor build numbers to the Microsoft Dynamics GP version I am working with, and I use the build number field for my own build number. You can use the Runtime_GetModuleInfo() command to retrieve this version information for an About window. Finally, select Total Compression to remove the source code from the final Chunk, and press OK. |
13. | Close the editable dictionary (File -> Close Editable Dictionary). |
That's it. Once you record this sequence as a macro, it usually takes less than 5 to 10 seconds to run. You can also edit the macro with Microsoft Notepad to change the build number and any other details.
Note: All the information on this page is available in the Dexterity Training materials and the Integration Guide manual that ships with Dexterity as a PDF document.
Based in Perth, Western Australia, David Musgrave has been working as a Microsoft Dynamics GP developer and consultant for 10 years (the past 3 with Microsoft). You may already know him from one of the nine Microsoft Dynamics GP newsgroups he monitors. He is currently working with the Microsoft Business Solutions Services Asia Pacific team as a support engineer and consultant. David is the original author of Named Printers, Advanced Security, Field Level Security, and Business Activity Statement (for Australian GST), and he has made a number of contributions to the code in the core Microsoft Dynamics GP Dictionary.