Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

VBA codes

Posted on by

Hi all,

I need VBA codes give an alert when am voiding a payable invoice.

the codes should read voucher number from pm20000 and pm30200 and then looks whether the voucher number exists in GL20000 but here the voucher number is in reference field.

When one clicks void button,if the voucher number exists in GL20000 (in reference field), it should give an alert.

RomRyan

*This post is locked for comments

  • Suggested answer
    Shyam Nath Profile Picture
    Shyam Nath 505 on at
    RE: VBA codes

    I think this is what you are looking for:

    SELECT TOP 1 REFRENCE FROM GL20000 WHERE REFRENCE IN (SELECT VCHRNMBR FROM PM10901 WHERE VENDORID = '<Vendor ID>')

    This will help you understand whether Voucher Number exists in GL20000 before you click void button in Void Open Payables Transaction window.

  • Romryan Profile Picture
    Romryan on at
    RE: VBA codes

    Leslie,

    In our way of processing some payable invoices,we use voucher number from a payable invoice,and put it in a reference field when we are making a GL transaction.This is not the way GP works but a customization.

    Note that the invoice is posted normally but the voucher number of this invoice is used  as a reference in a GL recurring batch.

    When you void the invoice,the recurring batch should be stopped and the already posted element of recurring batch backed out.

    So I needed an alert message because not all invoices go this way,so that if the invoice is attributed to a recurring batch relationship being reference field,I will be able to delete the recurring batch and backuot the element of the recurring batch that has posted already.

    RomRyan.

  • L Vail Profile Picture
    L Vail 65,271 on at
    RE: VBA codes

    Hi,

    If the invoice is posted, it will definitely appear in the GL20000 table. I'm not understanding the question. Do you have a lot of payables invoices that you post to the payables module but do not post them to the general ledger? I guess they would be sitting in the WORK tables as unposted GL transactions. When you void a payables transaction, it will automatically create a reversing entry in the general ledger. You would need to remember to delete the unposted general ledger entries as well.

    Please provide more information so that I/we can better help you resolve your problem.

    Kind regards,

    Leslie

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans