Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
When you create an XDS policy, you need to create a query for it as well. Usually you'd create this query in the AOT.
However, sometimes a query is too difficult to create in the AOT and easier to create in code.
Is it possible to create a query in code and then use it in an XDS policy?
If so, how?
It is not possible to use runtime queries as input for XDS policies. Possibly, you are looking for an easy way to control the outcome of a query? If so, you can use the so called "MyContruct" tables to collect data using x++ which fills a temporary table with user specific data. Have a look at one of my XDS examples which is using such MyConstruct table: dynamicspedia.com/.../extensible-data-security-examples-secure-by-retail-channel
Thank you Andre
Implementing an XDS method on a temp table worked. However, with regards to the XDS method that you implement on a temp table, have you ever had concurrency issues?
I've created a policy based on the workflow status of a Purchase Order. Everything works fine except when I try to approve a purchase order with the user who has the policy imposed on them.
When this user tries to approve the PO, I get a suspended query. SQL performs a count on the temp table, and then tries to truncate it. This truncate call gets suspended.
When I use the trace parser, it looks like an SQL cursor or holding on to the temp table, or at least onto PurchTable (which is the constrained table). I think the cursor is triggered by a queryRun.next() call.
Obviously you wouldn't be able to know what the solution is to this or what the problem is based on the little bit of information I've given here, so I just want to check if you've ever come across anything similar, or if you do know of any concurrency issues or hotfixes etc?
I have not seen this behavior, but had seen a scenario where the AOS crashed due to a very rare combination of calls. Can you tell a bit more about your policy? What does the query look like, what is the main constrained table, on what level is this PO constrained? How many records do you have in the purchase order table and how many records do you have in the temp DB? Is the temp table set to run on the TempDB database? What exact version of AX are you using?
Business Applications communities