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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Creation of AP Voucher and batch through Code

(0) ShareShare
ReportReport
Posted on by 1,197

I have a custom module, in which I can create a transaction and then Post to AP.

This "Post to AP" process should create a Voucher in AP module in work tables and a AP batch in which this voucher can saved.

Can any one help me on the scripts/procedures which can be used to create AP batches and vouchers by passing required parameters to the scripts.

*This post is locked for comments

I have the same question (0)
  • soma Profile Picture
    24,410 on at

    You can use eConnect to create a Voucher in AP module in work tables.

    Use the node <taPMTransactionInsert> under the schema PMTransactionType for creating vouchers in AP module.

    Note: To install eConnect go to your GP media and find the installer under the AdProd folder. Or download it from customer/partner source.

    Hope this helps!!!

  • Manjunath Vemula Profile Picture
    1,197 on at

    Thanks for providing solution through econnect.

    I am looking for creation of AP Batch and Voucher through Dex Code. Where I have a custom module, In which I want to Post my transaction to AP.

    So once user click on "Post to AP" button in the custom screen, I want to call the dex procs or functions to create the records in SY00500 and PM work tables.

    It would be great if you can suggest me on this.

  • Community Member Profile Picture
    on at

    Hi Manjunath,

    you can call the eConnect sql procedures such as

    taPMTransactionInsertPre/taPMTransactionTaxInsertPost.sql in your custom module/screen button by passing required fields to above sql procedures .

    note: eConnect needs to be installed.

  • soma Profile Picture
    24,410 on at

    An addition to the above Nataraj suggestion. You can create Payables Transaction with work status with help of eConnect Stored Procedures. The below are the SQL stored procedures used for creating Payables Transactions.

    taPMTransactionInsertPre - used to create Payables Transactions(Invoice, credit memo, finance charge, misc charge and return) with work status.

    taPMTransactionTaxInsertPre - used to create above Payables Transactions with custom tax details.

    taPMDistributionPre -  used to create above Payables Transactions with custom distribution accounts.

    For your case, if you want to create Payables Transactions(Vouchers) with default distribution accounts and tax details, use the SQL stored procedure taPMTransactionInsertPre.

    To identify the parameters for this procedure, go to SSMS and expand the company database--> Progarammability-->Stored Procedures then right click the stored procedure taPMTransactionInsertPre and select Script Stored Procedures As-->Create To-->New Query Editor Window.

    Hope this helps!!!

  • Manjunath Vemula Profile Picture
    1,197 on at

    Hi Nataraj and Soma,

    Thanks for your suggestions.

    I cannot use Econnect in my current case.

    Any other ways to get his done?

  • Manjunath Vemula Profile Picture
    1,197 on at

    I had used above mentioned  Procedures but I am unable to create records in PM work tables.

  • soma Profile Picture
    24,410 on at

    Can you show us the dexterity script for calling the Stored Procedure "taPMTransactionInsertPre"?

  • soma Profile Picture
    24,410 on at

    In Dexterity, we have other option for creating the PM vouchers in work table. The option is calling Dexterity procedure/function. First we need to identify the what all are the procedures/functions used for creating AP vouchers in GP. Already I have tried this way to created the AP vouchers in open tables. For open records(Posted records), dexterity has a common function. So, I have used this function to create the AP vouchers in Open table. For work table, I don't about the exact procedures/functions.

    To identify the procedure/functions, you can use script debugger to find the same.

    Hope this helps!!!

  • soma Profile Picture
    24,410 on at

    Follow below steps to create the script log file. 

    1. Locate the Dex.ini file. this file is located the under Data folder of your GP installation location.

    2. Open the Dex.ini file by using Notepad, and then add the following line:
      ScriptDebugger=TRUE
    3. Start Microsoft Dynamics GP. When you are logged on, the new Debug option appears at the right side of the toolbar.
    4. Open Payables Transaction Entry window.
    5. Click Debug, and then click LogScripts. You are prompted for the location in which you want the Script.log file to be created.
    6. Enter a new transaction and click save button.
    7. Click Debug on the toolbar, and then select LogScripts to turn off the Script.log file.

    Hope this helps!!!

  • Verified answer
    Manjunath Vemula Profile Picture
    1,197 on at

    Thanks Soma, for your quick and detailed responses.

    The Procedure to be used is "taPMTransactionInsert" but not "taPMTransactionInsertPre".

    With the SP "taPMTransactionInsert", I am able to insert records in to PM Work tables.

    Appreciate your quick help and responses.

    Thanks for your time.

    Regards,

    Manjunath V

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans