How to use a SQL view in SmartList Builder

Something I have been asked more than a few times is how to use a SQL view in SmartList Builder to create a new SmartList.  I am going to walk through this step by step using Dynamics GP 10.0 SP 3 and SQL Server 2005 SP 3:

 

STEP 1  -  create SQL view

To start we need a  SQL view.  I have published a number of views for getting GP data, so I will use one of my favorites – Payables Apply Information.  You can see the list of other SQL views I have published on my GP Reports page.

To create the view in SQL: 

  1. Open SQL Server Management Studio and connect to your GP SQL Server
  2. Click on the New Query button at the top left
  3. Copy the SQL code into the new window that opens (on my blog, I put the code to copy between tildes: ~~~~~)
  4. In the drop-down, select your GP company database:change-db
  5. Click Execute
  6. You will get a message saying “Command(s) completed successfully.”
  7. If you want to use your SmartList in multiple companies, repeat steps 4 and 5 for each company database

 

 STEP 2 - set up SmartList security for SQL view

Before we can use a SQL view in SmartList Builder we need to grant SmartList Builder security to that view:

  1. Log into GP as a user that has all the proper security access
  2. Open the SQL Table Security window by going to Microsoft Dynamics GP > Tools > SmartList Builder > Security > SQL Table Security
  3. Choose Views at the top
  4. Click on your company database on the left
  5. Find the view on the right and select it:sql-table-security
  6. If you created the SQL view in multiple company databases, repeat steps 4 and 5 for each company database

 

STEP 3 – create SmartList

Now we are ready to create the SmartList:

  1. Open SmartList Builder by going to Microsoft Dynamics GP > Tools > SmartList Builder > SmartList Builder
  2. Type in a SmartList ID and Name (the Item Name will default to the SmartList Name, I recommend leaving these the same to avoid confusion)
  3. Choose what Product and Series to put your SmartList in – this is a great new option in GP 10.0 and allows you to group SmartLists as you want.  This is also something that can be changed later, so some people like to create all new SmartLists is a separate place until they are satisfied with them, then move them to their ultimate location.  Up to you on this one.
  4. Click on the + sign to the right of Tables and choose SQL Server Table:slb01
  5. Check the Use Company Database checkbox if you are creating a SmartList that should run against whatever company database the user is logged into (or if you are planning that for the future)
  6. Click on the company database on the left
  7. Select Views and click on your view on the right
  8. Click on the + sign to the right of Key Fields and add Key Fields (these are used determine the current record selected when opening Go To’s) – at least one Key Field is required:slb02
  9. Click Save to return to the SmartList Builder window
  10. Every column in the view will be brought in as a field for the SmartList, at this point you can decide what fields to show, change formatting, etc., for now I will simply add all the fields available to the SmartList:slb03
  11. Once you’re done configuring all the additional options for your SmartList, click Save
  12. To finish creating the new SmartList, go to SmartList, and say Yes to the following message:slb04

 

Next steps & additional resources

Below are some additional resources for creating SmartLists and dealing with SmartList security in GP:

If you know of any other resources to add to this list, please let me know.

 

14 Responses to “How to use a SQL view in SmartList Builder”

  1. Hi Victoria,
    I’m learning more and have enjoyed you site. It is of great help.

    I’m using Smartlist Builder and trying to link the GL00201 table with the GL11110 table to create an actual vs. budget GL Smartlist. The issue is if there is data only appears if data exists in both tables for a GL Account for a specific period.

    Would this require a SQL view to do this, or is there anyway around this using Smartlist Builder.

    Your help is much appreciated,
    Gerry

    • Hi Gerry,

      When you’re linking the tables, are you using left join on the ACTINDX? If so, and it’s still not working, then you will most likely need to create a view in SQL first, then use that in SmartList Builder.

      -Victoria

  2. I admire the work you did and posted in the website. You saved me several times. :)

    Sorry if you have answered this before:
    Where can I find the list of all smart builber report names with folder nams in the tables structure

    Thanks,

  3. Hi Victoria,
    Do you have a list of all the common tables used on Extender; which one stores the Extender definition and which store the actual data?

    I find that the Import/Export function for extender only covers limited type, e.g. Forms, Windows etc but not other type such as View, Import, Menu etc.

    I had multiple databases created in a server and require to duplicte the Extender definition done from 1 master database to the rest of the databases. Since the import/export function does not covers all, I had resorted to using SQL integration services to copy files to the other databases. I would like to copy only the definition files and not the data files.

    Appreciate your kind advise.

    May
    Thanks

  4. Thanks a lot for putting up this.

  5. Victoria – GP9 Sp3
    I have a smartlist that was created using some views. We have a number of test companies and it seems that one of the views was linked by using one of the test companies in view selection, instead of live. How can I change this to point to live as opposed to the test company?

    As long as the view exists in live, is it as simple as exporting, replacing the database name in the xml file ( In the section ‘SQL Database Name’) and then re-importing?

    Issues that occur because of this are:
    If updating field names, have to replicate in test company as opposed to just live;
    If adding fields, again, have to do in test as opposed to live;
    If we removed the test company for any reason what repurcussions would there be on the smartlist.

    Help is always appreciated.
    Stu

    • Stu,

      It’s a little difficult to advise on this without seeing the exact setup of this as there are so many components that all need to work together. In general what I typically recommend is that all SmartLists are created with the Use Company Database checkbox selected – that way they will work in all companies and you don’t have to go crazy when you restore a current copy of live database over the test database.

      You could try making sure your view exists in the live company, granting security access to the live company view in SLB and then modifying your SmartList to have Use Company Database selected. This didn’t use to work very well in older versions of SLB, but I believe it should work in 9.0 SP3. If not, you could also try your method, but I am not sure that would work, I have not done that on the same server, only when ‘moving’ a SmartList from one server to another.

      -Victoria

  6. Sivakumar Venkataraman Reply April 22, 2009 at 9:07 am

    Hi Victoria

    Take a look at the URL of my blog where I have posted an article on Smartlist Security.

    http://cvakumar.com/msdynamics/2008/12/23/smartlist-builder-objects-using-sql-tables-and-views/

    This was created after I had this discussion with Mariano on his blog article Smartlist Builder Security for SQL Server Views.

    You can add this URL to your list as well. :)

    Regards
    Siva

Trackbacks/Pingbacks

  1. Using a SQL view in SmartList Builder « Dynamics GP Builders & Reporting - May 17, 2010

    [...] Yudin – How to use a sql view in Smartlist Builder  Pay special attention to the “Use Company” checkbox.  This is VERY important, and [...]

  2. How to use SQL view in SmartList Builder « Microsoft Dynamics GP Discussions - May 11, 2009

    [...] May 11, 2009 by smathew23 Victoria Yudin has a great article explains how to use SQL views in Micrsoft Dynamics GP – SmartLIst Builder. This is a must to read article if you use SmartList Builder. Here is the link to Victoria Yudin’s “How to use SQL views in SmartList Builder“ [...]

  3. SQL View in SmartList Builder - DynamicAccounting.net - April 21, 2009

    [...] View in SmartList Builder Victoria Yudin has a new post up on using SQL View's in SmartList Builder. Published: Monday, April 20, 2009, 11:00 [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 486 other followers