web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

VBA codes

(0) ShareShare
ReportReport
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

I have the same question (0)
  • L Vail Profile Picture
    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

  • Romryan Profile Picture
    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.

  • Suggested answer
    Shyam Nath Profile Picture
    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans