Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Programmatically replicating the full GP Sales Document cycle

Posted on by 545

Good evening,

Please pardon my green'ness below.  I do not know much about Accounting or GP.

I've been tasked with automating of my company's online products/services.  At the moment we're using a hodgepodge of custom code wisked together with a few 3rd party tools.  There is nothing other than the Web Services for GP Dynamics 2010 and/or eConnect service that I can repurpose.

So, I've created a Shopping Cart and a GP Item synchronizer that keeps our product offerings loosely coupled to GP.  And, I can create a GP Sales Invoice and (after implementing my own eConnect WCF service) I can ask GP for the next available Document Number...so I don't have to make one up.

I've written custom code to create an Authorize.NET credit card transaction, passing in the SalesDocument Key.ID as the Invoice Number, and I am able to update the Sales Document in GP with the Authorize.NET Transaction and Authorization numbers.

Now then, I thought I was home free until I realized the Sales Document must be POSTed to GP prior to applying Payments.  This is where I began to run into trouble.  In order to understand how much "could be" automated, I POSTed the Sales Document and it's really no longer a Sales Document...it is a Receivables Invoice (I believe).

I can progammatically fetch the Receivables Invoice from GP (GetSalesInvoiceByKey(key, context)) and I attempt to apply a Payment to the invoice but this is where I begin to run into all manner of problems.

I was hoping someone could point me into the right direction with the following questions:

1) The GP Thick Client is capable of POSTing a Sales Invoice.  Can I do this through eConnect?  I would imaging the GP Thick Client is built atop eConnect. Or, is this simply an Accounting Security kind of violation to do this?

2) Can I programmatically apply a payment to a Sales Invoice prior to it being posted?  How much crazy work would have to be done server-side to accomplish this?

3) What is the proper programmatic way of applying a payment to a POSTed Sales Invoice?

4) Does eConnect have any kind of "log all API calls" mode I can place it in so that I can understand how the GP Thick Client works when POSTing a Sales Invoice?

I ask these questions because I cannot seem to find any good resources online, in the product PDFs, or in the product print.  Also, I'm scouring the Dynamics SQL database in an attempt to determine how posting is accomplished...but I'd rather stick with the eConnect API worse case.

Any direction would be greatly appreciated.

 

Thanks,

Don

*This post is locked for comments

  • cnichols Profile Picture
    cnichols 155 on at
    RE: Programmatically replicating the full GP Sales Document cycle

    1. I've seen only a few ways to automatically post in GP.  One way I've seen it done requires an active GP client to be open, you can then programmatically tell the client to post the transaction.   Obviously, that isn't ideal.  The only other ways I've seen automatic posting in GP is through 3rd party software.    eOne Solutions has an automatic posting application called Smartpost that can be found here: www.eonesolutions.com/.../Features.aspx

    GP's client is NOT built upon eConnect.  eConnect was built as an integration tool.  Most of GP was built using Dexterity code.

    2.   You can programmatically apply a payment to an invoice prior to the payment being posted.  But I believe it is a requirement that the invoice is posted first.  

    3. I believe you want to enter your payment as a cash receipt using the eConnect taRMCashReceiptInsert object.   If you've done that, you can then apply the cash receipt to a SOP invoice by using the eConnect taRMApply object.

    4. The GP thick client does not use eConnect anywhere that I'm aware of.   You can modify your dex.ini file and turn some logging on to see some of what GP is doing.   Honestly, that logging typically creates more questions than answers.   It's not like following a typical VS2010 debugger...   I've found it useful to find tables certain tables that are being written to during a particular transaction, but it's a big jumbled mess in my opinion.   Also, there are some operations that happen that just don't seem to get logged.  The settings in the Dex.INI that you will want to turn on are

    SQLLogSQLStmt=TRUE

    SQLLogODBCMessages=TRUE

    SQLLogAlloDBCMessages=TRUE

    This will create a dexsql output file that you can view in a text editor.   These changes require you to close your client and reload before logging starts.   It will continue to log forever, so be sure to turn it off when you're done or you'll end up with a hefty log file on your hands.

  • Jerry Higgins Profile Picture
    Jerry Higgins 751 on at
    RE: Programmatically replicating the full GP Sales Document cycle

    eConnect is an an API which effectively duplicates a number of processes found within GP itself (GP is written using a language called Dexterity).   GP and eConnect are independent products which both  tie directly to the underlying GP databases.  GP is NOT built on top of eConnect (it'd be GREAT if it were, though).  Also you do not need to have one product installed in order to use the other.

    If you've not had a chance, there are some very useful Help files that are installed with eConnect.  They offer examples on how to prepare your XML data for integration.

    I've spent several years customizing GP8, GP10 and GP2010 using Modifer, eConnect, VBA and VSTools, and I still learn new things every day. :)  I'll try to answer your questions as best I can

    1. Based on prior info I've received, actually POSTING a transaction from eConnect cannot be done.  It could be done using VSTools, I suppose, though I have never tried it.  VSTools would require a session of the GP client to be running in order to do this.
    2.  You cannot programmatically apply a payment to an unposted Invoice.
    3. You can use eConnect to apply posted payments to posted Invoices via the RM Apply Schema <taRMApply>
    4.  Both eConnect and GP offer a logging mode which by default is turned off.  To use those modes, you can change settings in a config file for each product to log the SQL calls and messages.  Also, one of your best friends when dealing with eConnect & GP calls is SQL Profiler.  If you aren't already comfortable with that tool, I suggest learning more about it.

    A few more bits of info to help you out:

    GP Modifier - primary tool for adding, hiding and re-arranging GP windows.  If you want to add a button or text box to a stock GP form, then you must use this tool.

    Dexterity - language used to create Dynamics GP.  MS and many 3rd party vendors continue to use this language to extended GP.  Developing in this gets you "as close to the metal" of GP as possible.  You could conceivably create your own add-ons using this language to create your own auto-posting methods.

    VBA - Specialized version of VBA for Applications which can only be accessed when running a session of GP.

    VSTools - A .NET development suite which allows you to make the .NET platform available to GP's own windows and code.  Given a choice, I would always rather develop first in VSTools over VBA, but because VBA has been around much longer, it is more mature.   I have spent the last year porting our 30,000 plus lines of VBA code over to VSTools, but have found that some functions just run better, or are only available in VBA.

    eConnect - As mentioned above, eConnect is an API designed primarily to help with integrating data into work transactions, and also card data.  It CANNOT facilitate the POSTING of transactions.

    If you’d like to learn more about the how data is posted and routed between the various GP database tables, you might consider buying a copy of “Information Flow and Posting” from Accolade Publications (http://www.accoladepublications.com/gp-category1/2.html)  It is not cheap, but the information is invaluable and it is the only book I know of that covers such information.

    Last but not least, check out http://www.gpwindow.com/ - this is an all-inclusive site that attempts to bring together every last bit of info about working with GP.

    Good luck!

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans