问题
In Dynamics CRM-2011 the results of an advanced find are presented as a grid of records, each with a checkbox to select the record for further appropriate actions. Is it possible to use an SQL-based query to achieve a similar result?
I have implemented a data quality scheme as a business-rules entity, each rule containing the text of an SQL query for reporting records that fail the particular rule. There is an exceptions report that can run for any selected rule(s) and returns the list of failed records, which can be of any type (rule dependent). It would be great if instead of running as a report, it ran as a query and displayed the failed records with checkboxes to select them for action.
If anyone has any idea how this might be achieved, I would be grateful for any pointers.
Simon.
回答1:
I believe that your only option is a custom web application. You could select a business rule, have the application retrieve all entities that fail the rule, and display them in a standard grid from which you can select and perform actions on them. This application could use CRM styles and be launched within CRM to make it seamless with built in functionality.
回答2:
Rather than build a web app and all the plumbing that entails (authentication, hosting, maintenance, etc), another possible option is to build a console app. First, you'd build a relationship between your Rule entity and the entity in question, probably a many-to-many. Then your console app would find the "failed" records and relate them to the Rule record. This console app could be run on a schedule using Task Scheduler on a server.
End result is your users would still be able to use the CRM UI to see all "failed" records by just opening up the Rule record, as well as perform bulk actions on them.
来源:https://stackoverflow.com/questions/23367065/is-it-possible-in-dynamics-crm-to-run-an-sql-query-like-an-advanced-find-and-inc