Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Smartlist pointing to SQL view returning no data

Posted on by 65

I'm getting some weird results with a smartlist pointed to a custom SQL View. The view exists on each company in our instance. I am a POWERUSER in all companies. The other day I noticed that I wasn't able to query the view or the table it's pulling from in SSMS, I raised the question to our DBA team and they said no table level security was present, and today I was able to run queries. Suspect, but whatever... I figured that would solve the issue. it did not.

I have the SQL Table Security set correctly in each company to allow the connection in the GP application. I granted access to both the view and the custom table it's pulling from to be sure. It works fine on one of our companies. the rest just return no data.  I can't find any difference in the company where the SL works, and those where it doesn't.

If I log in with the SA account, the smartlist works fine on every company. This smartlist was not created by me, but I went back through step by step and everything seems to be fine. Is there some security flag within GP that i am missing that is blocking access to the data? or is there something in the SQL view/table that is?

Categories:
  • Suggested answer
    Joseph Markovich Profile Picture
    Joseph Markovich 3,900 on at
    RE: Smartlist pointing to SQL view returning no data

    Mike-

    In SQL Server Management Studio, you can also grant the permissions with this:

    use <your company database>
    go

    grant select on <yourviewname> to DYNGRP
    go

    Joe

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Smartlist pointing to SQL view returning no data

    You can run the GRANT.SQL script against your company database in SSMS. You will find this in C:\Program Files (x86)\Microsoft Dynamics\GP 2018\SQL\Util. This will grant the appropriate SQL access to everyone in the DYNGRP.

  • Mike Bresnan Profile Picture
    Mike Bresnan 65 on at
    RE: Smartlist pointing to SQL view returning no data

    Is that DYNGRP group what needs to be granted Select access for smartlists pointed at my view to work? I'm not a DBA by any means (and neither is anyone else at my company unfortunately) and our tech support team is less than knowledgeable. on the DB where i have select access, and the one that i don't, the view level granted access is blank. I'm assuming that means it must be granted at the DB level? unfortunately, my SSMS locks up when i try to see the securables for DYNGRP at that level, so i can't confirm...

  • Hokuminaria Profile Picture
    Hokuminaria 2,950 on at
    RE: Smartlist pointing to SQL view returning no data

    Hey Mike,

    This is going to be a tough one to troubleshoot over a forum. I can speak in regards to Smartlist Designer but if you are using Smartlist Builder i wont be able to comment on that.

    I would approach this the following way:

    1. First, i would run your view as a SQL Script and verify it returns data. 
      1. If it does not, then their is an issue with your view that needs to be corrected first.
    2. If you received results from running the View as a script in SQL and you are returned data, go through the article below on how to create a Smartlist based off a view.

    How to create a Smartlist Designer report using a SQL View (microsoft.com)

    I hope this helps!

    Thank you!

    Brandon Jarrett | Microsoft Support Engineer.

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans