public class MyForm extends FormRun implements SysPackable
{
}
Below taking the example of to implement a method on each form part that is used on the workspace that would get a filter value from its parent workspace form and trigger those methods each time a modified() method is triggered on a workspace itself. However, this solution has two main issues. First, some controls may not be present on the workspace itself, but they can be located on the setup dialog, that is called from the workspace instead (like the inventory dimensions’ setup).
Second, the count tiles are basically menu items with a particular query specified, so there is no way to create or trigger any method within them.
Tile filtering and form part filtering share common interfaces and still, there are some differences in implementation. Below are instructions for both:
Tile Filtering
Create a new AOT query and use it as a source for the count tile.
Create a new class that implements the SysIFilterStructureStrategy interface and extends the SysFilterStructureStrategyQuery.
Implement the SysIFilterProvider interface for your workspace.
Add methods that will bound the filter control with the SysIFilterStructureStrategy engine.
Form Part Filtering
The Form part filtering shares the same approach as the Tile filtering but it requires an additional code on the form part itself.
Create a new form part and use the AOT query as the main datasource for the form. It will be used to filter for data. Implement the SysIFilterEventHandler and SysIFilterConsumerForm interfaces.
Create a new class that implements the SysIFilterStructureStrategy interface and extends the SysFilterStructureStrategyQuery similarly to the class described in the Tile filtering section of this article
Add methods that will bound the form datasource with the filter control from your workspace.
Add your form part to the workspace and set the RunMode property value to Local.
Please note: The solution described above utilizes Dynamics 365 for Finance and Operations cache and tile cache storages. The query or class renaming might require the usage data and tile configuration refresh.
No comments:
Post a Comment