Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Create Sales by State (Location) with SQL Statement

Posted on by

Our site is importing invoices from another system into GP Dynamics so the SOP tables are not being populated. However all customer information is in GP so I would think linking the sales totals to a customer file would be straight forward but I'm having trouble finding where I should be linking this information together.

I would love to be able to tie all customer file info to the corresponding invoice (sales) for aggregate reporting.  I've tried tinkering with the Originating Master info but it is not complete enough to get detailed customer file info like city, ship-to or state.

*This post is locked for comments

  • David Posey Profile Picture
    David Posey on at
    RE: Create Sales by State (Location) with SQL Statement

    Excellent!  Thanks for your help!

  • Verified answer
    MattPaulen Profile Picture
    MattPaulen 6,910 on at
    RE: Create Sales by State (Location) with SQL Statement

    If the customer info is stored in GP you should then be able to join on ORMSTRID and the CUSTNMBR field from RM00101 (or RM00103 if needing the customer address table).

    Here's a sample query I put together that is just taking in to account credit amounts (obviously this would need to be fleshed out more)

    SELECT TOP 100 cust.STATE,SUM(CRDTAMNT) AS [Sales], PERIODID FROM GL20000 gl

    LEFT JOIN RM00101 cust

    ON gl.ORMSTRID = cust.CUSTNMBR

    WHERE SOURCDOC = 'SJ'

    GROUP BY cust.state,gl.PERIODID

    ORDER BY cust.STATE, PERIODID

  • David Posey Profile Picture
    David Posey on at
    RE: Create Sales by State (Location) with SQL Statement

    Yes Originating Master ID is the populated item.

  • MattPaulen Profile Picture
    MattPaulen 6,910 on at
    RE: Create Sales by State (Location) with SQL Statement

    In Smart Connect,  it would be the Destination Group and Node Type that would specify the module and transaction type that it is being imported in to.  If it is just Financial, the Originating Master ID is typically what would tie to the customer ID.  Is that being populated by the integration?

  • David Posey Profile Picture
    David Posey on at
    RE: Create Sales by State (Location) with SQL Statement

    That's a good question.  We are using Smart Connect to import the invoices.  Where would I look to see the destination module?


    If I had to guess it appears this is being imported in the Financial Module.

  • MattPaulen Profile Picture
    MattPaulen 6,910 on at
    RE: Create Sales by State (Location) with SQL Statement

    What module are you importing the invoices in to?

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans