#GPPT Defaulting Customer ID and Vendor ID fields for new records

David Meego - Click for blog homepageThis week I received two similar requests and so I thought I would publish a couple of sample customizations which achieve the desired goals.

If you want to have a standard templates when adding Customer IDs and Vendor IDs, these two samples will provide that functionality with just a few triggers using the GP Power Tools – Developer Tools module.

Please note that this code is designed to work with Build 28 of GP Power Tools. There are separate projects and downloads for Customer Maintenance and Vendor Maintenance.

There is a trigger which runs when the window is opened which moves the cursor to the Customer Name and Vendor Name field, respectively. When a Name is entered, a second trigger runs and creates a prefix based on the first 8 letters entered. Then the code finds the first available number with that prefix and inserts that into the Customer ID or Vendor ID fields.

This second trigger also defaults in the primary Address Code and Class ID fields. You can adjust the code to change the defaults used or comment the code out if you don’t want that feature.

You can also adjust the code if you want to change the number of letters used for the prefix and the number portions of the resulting number.

In the screenshot below, “This is a Test” was typed into the Customer Name field and then tab was pressed. The Customer ID was defaulted to “THISISAT0001” and the Address ID and Class ID fields were populated. Pressing tab confirms the Customer ID and then you can enter the rest of the fields.

There is a third trigger in each project which is currently disabled. This trigger moves the focus to the Customer Name or Vendor Name field if it is blank and the focus is changed to the Customer ID or Vendor ID field (respectively). This is disabled to allow the custom SQL Lookup and Auto Lookup samples to work along side the auto Customer ID and Vendor ID functionality.

Check out these really cool lookup samples here:

When installing the sample code for the first time use the Configuration Export/Import window as the Project does not exist in your system yet. Just download the configuration settings file from the link at the bottom of this article. Extract the contents of the zipped archive, open Configuration Export/Import and select the configuration settings file. Click Import and click OK on the Import Settings File window when it is displayed.

Download here:



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

One thought on “#GPPT Defaulting Customer ID and Vendor ID fields for new records

  1. I developed a scheme in 2001 that handled 99.9% of over 2 million customers with the 15 Character limit of GP’s Customer ID if you would like to compare notes. Last/First name Alpha – not numeric (which I HATE!), so the native search works well if you know the scheme.

    Clark A. Patterson
    CAP Services, LLC

    Liked by 1 person

Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.