Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Generating Customer Number in VBA

Posted on by Microsoft Employee

We just upgraded from 6 to 10 and I'm beginning to assess all the Modifier and VBA changes that need to be done in 10.

As a business practice, we don't want the user to have to come up with the customer number.  So in 6.0 we have some VBA on the Customer Maintenance that has the user enter a new customer's name and then the VBA goes and grabs the largest customer number and increments it by 1.  Then it executes a SQL statement against RM00101 to add the new customer, filling in just the customer number and name.

 Is that still something valid that I can do in VBA with 10?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Generating Customer Number in VBA

    You can try doing what Standard GP does when it fetch PO Number or SOP Document Numers, though it would require a bit more work.

    Save the "Next Customer Number" in a Custom Table (or you can even check some of the RM Setup User-defined fields or some place where you can manage to find in GP itself).

    While entering a new Customer, fetch the value from this field and Increment it immediately. So even if multiple users try to create a Customer, the Increment will take care, though fractions of time does matter and sometimes you tend to get a clash, but that's rare.

    I guess, that's one option you can try out.

    Thanks
    Vaidy
    http://vmdyngp.blogspot.com

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Generating Customer Number in VBA

    That's been my concern as well; however, that's what the long-gone consultants put in place and I was handed to maintain.  It hasn't been an issue, though, in 6 years of using GP, as we generally only have one or two individuals permitted to add customers out of a total of maybe 8 or 10 users total.

    Is there anything you might recommend to improve it?  Have you seen any other organizations with a similar requirement to auto-gen the customer number?

  • winthropdc Profile Picture
    winthropdc on at
    Re: Generating Customer Number in VBA

    This customisation is still valid in v10.0

    My only concern is that it is not multi-user friendly.  If two people go to add a customer at the same time they will be given the same number. 

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans