Home » Listing Details
Top Websites
  1. Dynamics GP Help
    Over 5600 resources listed.
  2. Mark Polino's DynamicAccounting.net
    Over 5100 resources listed.
  3. Rose Business Solutions Blog New
    Over 2200 resources listed.
  4. Developing for Dynamics GP - By David Musgrave and the MS GP Dev Support Team
    Over 1100 resources listed.
  5. Mariano Gomez at The Dynamics GP Blogster
    Over 900 resources listed.
  6. Microsoft Dynamics Partner Community Blog
    Over 900 resources listed.
  7. Christina Phillips, Steve Endow & Lorren Zemke at Dynamics GP Land
    Over 700 resources listed.
  8. Mohammad Daoud's Dynamics GP Blog
    Over 600 resources listed.
  9. Vaidy Mohan at Dynamics GP - Learn & Discuss
    Over 500 resources listed.
  10. Inside Microsoft Dynamics GP Official Blog
    Over 500 resources listed.
  11. eOne Business Solutions Blog
    Over 400 resources listed.
  12. About Dynamics, Development and Life
    Over 300 resources listed.
  13. Frank Hamelly at GP2theMax
    Over 300 resources listed.
  14. Dynamics CPM
    Over 300 resources listed.
  15. BKD Dynamics GP Insights Blog
    Over 200 resources listed.
  16. Leslie Vail at Dynamics Confessor Blogspot
    Over 200 resources listed.
  17. Victoria Yudin's Dynamics GP Website
    Over 200 resources listed.
    Victoria Yudin
  18. Janakiram M.P. at DynamicsBlogger
    Over 100 resources listed.
  19. VS Tools Forum
    Over 100 resources listed.
    Your Resource for Visual Studio Tools for Dynamics GP
  20. Inside Microsoft Dynamics GP Official Blog
    Over 100 resources listed.
  21. US Dynamics GP Field Team Blog
    Over 100 resources listed.
  22. Catherine Eibner MBS Developer Evangelist
    Over 100 resources listed.
  23. Sivakumar Venkataraman at Interesting Findings & Knowledge Sharing
    Over 100 resources listed.
  24. Dynamics Small Business
    Over 100 resources listed.
  25. Belinda, The GP CSI
    Over 100 resources listed.

ID:34238
Title:Tech Tuesday – Sum Document Line Amounts Using Global Variables
URL:http://eonesolutions.blogspot.com/2013/08/tech-tuesday-sum-document-line-amounts.html
Description:Today's Tech Tuesday article comes to you from our Professional Service Director, Lorren Zemke:

Depending on the data source, there may be a time where you need to sum amounts from the line items into a document header. You may have a document that contains distribution details that need to be rounded or multiple data elements that need to be added together to store at the document header level. For this article we will be talking about summing amounts from an Excel file that has distribution amounts we need to sum together to create the voucher amount.

First, we will create a Global Variable that can be used to sum the values at a document line level and stored at a document header level. We start by creating a global variable which we will call GBL_PAYABLESTRXAMOUNT and assign a default value of 0. You can view a previous blog entry on how to create Global Variables and assign default values. http://eonesolutions.blogspot.com/2011/04/tech-tuesday-global-variables.html

We will start with our Distribution node to create our calculated amounts that need to be summed. Our document source contains debit and credit amounts that may be negative or positive so we will create a calculated column for each.  Below is our DEBITCALC amount and we will do the opposite for the CREDITCALC.




We map the calculated Credit and Debit amounts to the distribution Credit Amount and Debit Amount destination columns respectively.



In the Restrictions script we sum the Debit and Credit calculated amounts to our Global Variable since the Restrictions script runs for each line in our data source while creating the Payables Distribution.

 


We are returning true in all cases for our Restriction because we are not restricting any lines just using the process for summing our values.

Now, we move to the Payables Header node where we take the summed amount and map it to the Payables amount.  To get the global variable amount create a new calculated column to return the global variable since we cannot use the global variable as a source column.

 


Normally in our calculated column we would clear the global variable for this document so the system would not continue to add amounts for multiple documents together. But Payables also has another destination column where we want to use the same amount as our purchases amount we will create another calculated column and clear our global variable in that calculation.
 



Once the document amount calculations have been created, map them to the destination columns.

Have further questions or comments on what Lorren shared? Drop him a line at lorren.zemke@eonesolutions.com.

Category:
Link Owner:
Date Added:August 28, 2013 12:59:16 AM
Number Hits:1
RatingsAverage rating: (0 votes)
Reviews

No Reviews Yet.

 
GPWindow.com

Thank you for your support for GPWindow. It helps us cover part of the hosting costs for GPWindow.