SQL timeout querying secure attributes

This week one of our users was suffering a SQL timeout when she was trying to open a particular view or run the same in the Advanced Find. The issue was caused by a secure field that was used in the criteria of the query.

We checked the web traces to confirm the query that was forcing this timeout and get more details:

Then we look at again the actual query run by this view:

Finally we noticed that the account Tier attribute was secure and it was part of a field level security profile that our user was not part of. As soon as our user was part of this profile, she was able to run the query very quickly without issues. 

Conclusion: It is better to avoid secure attributes on the criteria of our views or queries because it could bring unexpected results or even platform errors as we have seen in this article. Only use them so if you are 100% sure everyone who is going to use the view or query got access to the corresponding secure attributes by some field level security profile.

Note: This issue happens for Microsoft Dynamics 365 Customer Engagement version 9.1.0.2055 (Online)

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 )

Google photo

You are commenting using your Google 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