Dynamics SL Custom Table Permissions for PV Lookups

I created a PV Lookup (showing Possible Values) for a custom table for a Microsoft Dynamics SL 2015, CU 1, SDK application. Immediately after pressing F3 I got a TargetInvocationException in Visual Studio. The Visual Studio Output window listed an unhandled exception in the Microsoft.Dynamics.SL.Controls assembly at SetSqlDataSource. Digging into the Call Stack showed the exception came from the CTLBPVSql method in the swimapi.dll. A SQL Trace showed a statement that ran correctly using my credentials, but Dynamics SL runs it as the login created for reports, E8F575915A2E4897A517779C0DD7CE. I hadn’t granted Select permission on the custom table for that database user, and doing so immediately resolved the issue.

My conclusion: when creating a custom table for Dynamics SL 2015 for an SDK application, always grant Select permission to this user. Hopefully all the technical stuff in this post will help you find you way here if you run into the same thing! Who would guess that a TargetInvocationException would be resolved by granting a SQL Select permission?

GRANT SELECT ON [xYourCustomTable] TO [E8F575915A2E4897A517779C0DD7CE]

1 Comment

  1. Elizabeth Britton November 11, 2016 9:42 am  Reply

    I was researching content for our social media strategy and came across your fantastic website. I just wanted to reach out and make an introduction. My name is Elizabeth Britton, and I’m a Marketing Coordinator with Syncfusion. If you would like to try out Syncfusion’s products for free and write a review about them on your blog, I would love to get in touch! Please let me know of any content you may want to see mentioned in our social media. Keep up the great work!

Leave a Reply to Elizabeth Britton Cancel reply