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 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.
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.
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156