Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Smartlist Builder - Create report two show sales transactions but for only two account category numbers

(0) ShareShare
ReportReport
Posted on by

I am trying to create a report that shows the distributions for our sales invoices but for only Account Category Numbers 31 and 32, and only when both numbers exist. I can get the report to generate with all of the invoices but I can't figure out how to restrict it to say, if 31 has a 32 distribution account category number type then only populate that data. Please help!

*This post is locked for comments

  • Victoria Yudin Profile Picture
    22,768 on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    You should be able to do that with some fancy SQL, however, what happens if you have a transaction that has more than one distribution for one of those categories?

  • Community Member Profile Picture
    on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    I was able to get the data to pull perfectly, so thank you so much for your assistance! One last thing, Is it possible in Smartlist Builder to have the GL account for Act # 31 and then next to that have the GL account for Act #32, side by side, instead of underneath?

  • Suggested answer
    Victoria Yudin Profile Picture
    22,768 on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    Sorry, I misread your post. You will need to link your results to the GL00105 table.

    RM10101.DISTINDX = GL00105.ACTINDX

    In GL00105 the field that holds the full account number is ACTNUMST.

  • Community Member Profile Picture
    on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    I am able to return results but the issue that I am now having is that I need to see the actual GL accounts associated, and that information is what I cannot seem to get.

  • Victoria Yudin Profile Picture
    22,768 on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    Your code works for me using our production data. A few thoughts:

    • Do you have the Fabrikam test company installed? Can you try it against that database (TWO)? That should give you results.
    • Your company may be moving transactions to history right away. So you want to check the RM30301 table instead or in addition to the RM10101 table.
    • Also, you're not limiting your code to invoices, which could cause a problem with the data if you have different transaction types with the same Doc Number. But that would cause you to have more results, not less. Just adding this for when you solve the other issue.
  • Community Member Profile Picture
    on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    I have created the view but none of the GL accounts are showing. Can you provide any advise as to what I am doing wrong?

    select *

    from RM10101

    where DISTTYPE = 9 --only invoices

    and DISTTYPE  in --invoices that have acct with cat 31

    (select DISTTYPE

    from RM10101

    where DISTTYPE = 9

    and DSTINDX  in

    (select DSTINDX from GL00100 where ACCATNUM = 31))

    and DISTTYPE in --AND invoices that have acct with cat 32

    (select DISTTYPE

    from RM10101

    where DISTTYPE = 9

    and DSTINDX in

    (select DSTINDX from GL00100 where ACCATNUM = 32))

  • Suggested answer
    Victoria Yudin Profile Picture
    22,768 on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    I don't know if you're going to be able to do this directly in SmartList Builder. I would recommend creating a SQL view with the logic you need, then using that view in SmartList Builder.

    In SQL you can use something like the code below to get a list of all the distributions for invoices that have accounts from both categories: 

    select *
    from SOP10102
    where SOPTYPE = 3 --only invoices

    and SOPNUMBE in --invoices that have acct with cat 31
    (select SOPNUMBE
    from SOP10102
    where SOPTYPE = 3
    and ACTINDX in
    (select ACTINDX from GL00100 where ACCATNUM = 31))

    and SOPNUMBE in --AND invoices that have acct with cat 32
    (select SOPNUMBE
    from SOP10102
    where SOPTYPE = 3
    and ACTINDX in
    (select ACTINDX from GL00100 where ACCATNUM = 32))

  • KirkLivermont Profile Picture
    5,985 on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    Any reason you can't publish a data connection for this and then use Excel to build in the logic you need?

  • Community Member Profile Picture
    on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    What would the code for that be in the calculation? I can get the gl code types to only show 31 and 32, the issue though, is that there are several transactions that use the account type of 31 that do not necessarily also have a posting account type of 32. But that is what I need, If account type 31 also has a posting account type of 32 I need that info only to populate.

  • Community Member Profile Picture
    on at
    RE: Smartlist Builder - Create report two show sales transactions but for only two account category numbers

    create a calculation and choose the transactions where that calculated value is not zero?

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans