limj
2023-10-24 93652435728de839582440eefd5122c281181d35
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
Quintiq file version 2.0
#parent: CustomDrawComponent
Response OnClick () id:Response_CustomDrawComponent_MenuSCDNewUnit_OnClick
{
  #keys: '[110880.3.972640080]'
  Body:
  [*
    // Create a new Unit
    ApplicationLibMacroPlanner.SupplyChainDiagramLastClickedLocation( this.ContextMenuClickAction().X(), this.ContextMenuClickAction().Y() );
    dlg := construct( DialogCreateEditUnit );
    
    dlg.NewUnit( this, DataHolderFocusedUnit.Data(), ValueHolderX.UserData(), ValueHolderY.UserData() );
    
    // Toggle on value holder to indicate changes
    ApplicationLibMacroPlanner.SetSupplyChainOverviewWarning();
  *]
  CanBindMultiple: false
  DefinitionID => /CustomDrawComponent/Responsedef_CustomDrawComponent_Menu_OnClick
  InheritSecurity: false
  Initiator: 'MenuSCDNewUnit'
  Precondition:
  [*
    return SupplyChainView::CanCreateUnit( MacroPlan, DataHolderFocusedSP.Data(), feedback );
  *]
  UserRequiresReadWrite: true
}