#GPPT Adding Custom Fields to Microsoft Dynamics GP without using Code or Modifier part 2

David Meego - Click for blog homepageEveryone wants extra user defined fields on their Microsoft Dynamics GP windows. In the previous article we showed how easy it is to add extra fields using GP Power Tools and its new Custom Fields feature.

Now we have a new problem …. “Scope Creep”. The HR department has realized that their employees might have more than once pet and so would need allow for multiple types of pets to be selected.

Custom Fields combines the Custom Tables functionality (added in Build 32) and the Virtual Fields functionality (added in Build 31) and provides a simple configuration to add any field from a Custom Table, onto any window, in any product dictionary of Microsoft Dynamics GP, without needing any scripting, or any changes to the window with Modifier.

Changed Requirements

The HR Department has decided they would like to track the details of their employees’ pets. They want to track the name and species of the pets. However, they now want to track multiple pets rather than be limited to one pet.

Implementation Updates

Project Setup

To avoid changing the original project from the previous article, it has been duplicated into a new EMP_CUSTOM_FIELDS2 project, the Custom Table and Custom Field resources were automatically renamed to match. Also make the following changes:

  1. Project Description: Add word “Extended”.
  2. Make this project the Current Project.

NOTE: This duplication step is only necessary if you want to keep the previous iterations of the project. Don’t forget to disable the EMP_CUSTOM_FIELDS project.

Custom Table Setup

On the EMP_CUSTOM_FIELDS2 custom table the following changes have been made:

  1. Table Description: Add word “Extended”.
  2. Technical Name: Add number “2”
  3. Physical Name: Add number “2” and respond “Create New” to the dialog. This will create a new table, so that the original table is not renamed.
  4. Change Field: Pet Name to Pet Names by adding an “s” to both Technical and Physical Names. Also changed the Length from 80 to 100 to provide more space.
  5. Change Field: Pet Type to Pet Types by changing from datatype Integer to Multi-Select List Box.
  6. Click Save and acknowledge the warning that this table is used by Custom Fields, then closed the window.

Custom Field Setup

On the EMP_CUSTOM_FIELDS2 custom field the following changes have been made:

  1. Field Description: Added word “Extended”.
  2. Double clicked on Pet Names and changed the Length to 100 and the Field Prompt to Pet Names. Clicked OK.
  3. Double clicked on Pet Types and changed the Field Type to Multi-Select List Box and the Field Prompt to Pet Types.
  4. Clicked the Expansion Button to confirm Types are still there. Removed the Snake, Shark and Spider options (apologies if you have one of those as a pet). Clicked OK.
  5. Clicked Save and closed the window.
  6. From the Project Setup window, click the Open Form (optional) hyperlinked prompt to open the Employee Maintenance window.

All the changes made have taken affect, but the Pet Types Multi-Select List Box is only showing one item at a time making it hard to use. Don’t worry we can fix that.

Open Custom Field Setup, click in the tree on the window, or any of the fields in the window, and click the plus symbol to the right of the tree, then add four spaces (click OK on the window that opens each time).

Now click on the Form Name hyperlinked prompt on the Custom Fields Setup window to save and open the Employee Maintenance window.

New Solution

You will see that the Multi-Select List Box has automatically expanded to fill the added space, and we can now add multiple pet names and pet types.

Stay tuned for the next article where there is more “Scope Creep” after the boss decides to add some more fields.

Downloading and Installing

Download the example code, import using the Project Setup window (requires at least build 33 as it uses Custom SQL Tables and Custom Fields):

The custom fields will be active immediately.

More Information

Here are all the parts of the series (available once published):

For more information see:

If you are interested getting early access to the Custom Fields functionality and Build 33 of GP Power Tools, please contact us. As always, your feedback will help improve the product and its features.

To stay informed for more details and release notices, please subscribe to this blog and our Newsletter mailing list.

Tell us in the comments how you would use this great new feature.

Thanks

David

This article was originally posted on http://www.winthropdc.com/blog.

2 thoughts on “#GPPT Adding Custom Fields to Microsoft Dynamics GP without using Code or Modifier part 2

Leave a Reply