Architecture¶
This page describes how the drilldown plugs into the box module lifecycle and which existing infrastructure it relies on.
Lifecycle hooks¶
Three module lifecycle hooks are wired up on COrdersCausingShortages.
CreateInstance¶
A ShareID is set on the details query view so saved drilldown layouts are filtered to this module:
This ensures that layouts a user saves while drilling into MRP Orders Causing Shortages are listed separately from layouts saved against the same underlying optimized table (MRP_Details) from other contexts.
Refresh¶
The main report's gridview is configured to highlight rows on hover, which is also what the framework uses to show the drilldown affordance:
Protected Overrides Sub Refresh()
MainGridView.MouseOverStyle = MyGridView.MouseOverStyles.Row
End Sub
Why this matters
Without MouseOverStyle = Row, the drilldown cursor and row underline do not appear on the main report's rows.
Layout persistence: DataSaveBegin and DataLoadEnd¶
The drilldown's saved layout (visible columns, grouping, sort order, column widths, filter strings) is round-tripped through MyData.m_DetailsLayout so it persists across sessions:
Private Sub DataSaveBegin(ByVal sender As Object) Handles Settings.DataSave
MyData.m_DetailsLayout = m_DetailsQueryView.MyData
End Sub
Private Sub DataLoadEnd(ByVal sender As Object) Handles Settings.DataLoad
m_DetailsQueryView.MyData = MyData.m_DetailsLayout
End Sub
This is the supported way to persist a drilldown layout in the box module framework.
The OnDrillDown override¶
OnDrillDown is invoked by CBoxModule when the user double-clicks a data row on the main grid. The override:
- Validates that the necessary columns are visible on the source report (
item_no,mrp_trx_dt). - Reads
item_no,mrp_trx_dt, and optionallyitem_locfrom the clicked row. - Resolves the week range that contains
mrp_trx_dtusing the main calendar'sProductionWeekStart. - Queries
#FlatBOMto find all item numbers related to the drilled item. - Sets mandatory matrix elements on
m_DetailsQueryView. - Builds criteria on
PrimaryLayoutInterface.Criteriafor the resolved item list, optional location, and week range. - Applies a default layout if none is saved (see the Default layout fallback page).
- Opens the drilldown form via
PrimaryLayoutInterface.Layout.GetDrillDownFormandDisplayDrillDown. - Attaches the cell color-coding handler and turns on
AutoExpandAllGroups.
The control flow is sequential and entirely within OnDrillDown — there are no event subscriptions or asynchronous steps.
Reused infrastructure¶
The drilldown uses these existing components without modification:
PulseDevTools.DynamicQuery.CQueryViewandCLayoutInterfacefor the layout and criteria model.Pulse.TableManager.Table(enumOptimizedTable.MRP_Details)as the data source for the drilldown.Pulse.Calendar.GetWeek(date, ProductionWeekStart)for resolving the week containing a transaction date.FDrilldownas the drilldown form, accessed viaPrimaryLayoutInterface.Layout.GetDrillDownForm.AppCon.FillDataTablefor the one-shot BOM-related-item lookup query.
What was deliberately not added¶
- No new tables or persistent state. The drilldown reads from
#FlatBOM(assumed present and in scope when the drilldown runs) and the standard MRP optimized table. - No changes to
RefreshMyOptimizedTable. The main report's view definition is unchanged. - No new matrix elements. All columns the drilldown displays already existed in the matrix.