yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Quintiq file version 2.0
#parent: #root
Response OnOpenedView () id:Response_ApplicationLibMacroPlanner_OnOpenedView
{
  #keys: '[108486.0.1959235418]'
  Body:
  [*
    // Process initialization on open view
    this.InitializeNavigationPanel();
    
    // Only allows the dialog to open if opened from a form (frame) or opened from development preconfigure dialogs
    // These dialogs have to match the dialog in the Edit -> Pre-configure dialogs response.
    dlgs := selectset( Frame,
                       SubComponents.astype( Dialog ),
                       dlg,
                       dlg.istype( DialogShowProcessDependency  )
                       or dlg.istype( DialogEditKBCategoryAuthorization )
                       or dlg.istype( ScenarioManager_DialogEditScenarioAuthorization  )
                       or dlg.istype( ScenarioManager_DialogCreateEditStrategy  )
                       or dlg.istype( DialogSanityCheck )
                       or dlg.istype( DialogShowOperationFeedback )
                       or dlg.istype( DialogShowTripFeedback )
                       or dlg.istype( DialogCreateEditInventorySupply )
                       or dlg.istype( DialogCreateEditInventoryValueAndCost )
                       or dlg.istype( DialogCreateEditUnit )
                       or dlg.istype( DialogCreateEditStockingPoint )
                       or dlg.istype( DialogCreateEditPISPSpecification )
                       or dlg.istype( DialogCreateEditOperation )
                       or dlg.istype( DialogCreateEditLaneLeg )
                       or dlg.istype( DialogCreateEditLane )
                       or dlg.istype( DialogImportProfile )
                       or dlg.istype( DialogImportObjectGroupInProfile )
                       or dlg.istype( DialogEDIImport )
                       or dlg.istype( DialogEDIExport ),
                       true
                     );
    
    traverse( dlgs, Elements, dlg )
    {
       dlg.Close();
    }
    // End
    
    // Open the SanityCheckDialog if user switched view via the SanityCheckDialog
    if( [Boolean]ValueHolderShowSanityCheck.Value() )
    {
      ApplicationLibMacroPlanner.ShowSanityCheck();
      // Set nav to root to ensure the visibility of the erroneous instances
      ApplicationLibMacroPlanner.SetNavigationToRoot();
      ValueHolderShowSanityCheck.Value( false.AsQUILL() );
    }
    
    this.ReselectElementsInNavigationPanel();
    
    // Whenever user opens a view, we need to flush DataHolderHideUnits,
    // DataHolderHideUnits stores all child Units that's supposed to be hidden in FormCapacityPlanning when the user double clicks on a Unit
    // It is requested that when the view is changed or Stocking points and units in Navigation panel selection is changed,
    // we need to expand them all again, that's why we flush the data holder here whenever a view is opened
    form := Application.Frame().FindChildObject( typeof( FormCapacityPlanning ).Name() ).astype( FormCapacityPlanning )
    
    if( not isnull( form ) )
    {
      form.DataHolderHideUnits().Data().Flush();
    }
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_Application_OnOpenedView'
}