Developing for Dynamics GP

by David Musgrave (Perth, WA, Australia) and the Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

Adding AutoComplete Items with Dexterity

Adding AutoComplete Items with Dexterity

  • Comments 2

Dave DusekThis is a quick and easy way to add items to the AutoComplete list for a field.  I'm talking specifically about the AutoComplete property on a field. 

In this case, the customer didn't want to use the lookup window to select an existing item number, they wanted it to be in the AutoComplete list.  The problem is that in order for it to get into the AutoComplete list, you have to select or type it at least one time.  They wanted all of the items in the AutoComplete list right away without selecting or typing.  So this code does that for them.

The field we are targeting is the Item Number field.  This will populate any Item Number field in GP, but we need to pass a window field to the AutoComplete_AddStringValue() function, so in this case, we will use the SOP Entry window.  The code below was added on a form trigger so the user could select to update AutoComplete items.  This code could take a while depending on how may items they have, so you have to be careful when you run it and the SOP Entry window does have to be open.  Also, the AutoComplete tables are local tables, so this does have to be run on each machine for each user.

Example code to update AutoComplete data

Dave Dusek
Dynamics GP Developer Support

// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

Page 1 of 1 (2 items)
Comments Information

PLEASE READ BEFORE POSTING

Please only post comments relating to the topic of this page.

If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.

Leave a Comment
  • Please add 3 and 3 and type the answer here:
  • Post