yanweiyuan3
2023-08-09 fd693f0faf305ec98d7ea03e09fe6787817e71d7
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
Quintiq file version 2.0
#parent: #root
Method GetChangeOfLeadTimeStrategyWarningDialog (
  String laneleadtime,
  String operationleadtime
) as Boolean id:Method_FormGeneralSettings_GetChangeOfLeadTimeStrategyWarningDialog
{
  #keys: '[144528.1.1737103871]'
  Body:
  [*
    // Prompt user with warning dialog if user changes lead time settings
    proceedSave := true;
    hasnewleadtimestrategy := MacroPlan.GlobalParameters_MP().LaneLeadTimeLogic() <> laneleadtime
                                or MacroPlan.GlobalParameters_MP().OperationLeadTimeLogic() <> operationleadtime;
                                
    if( hasnewleadtimestrategy )
    {
      message := Translations::MP_MacroPlan_ChangeOfLeadTimeStrategy();
      showModal := true;
      proceedSave := WebMessageBox::Warning( message, Translations::MessageBox_YesNo(), showModal ) = 0;
      
      // Reset here as no code executed after Form.ApplyChanges() 
      if( proceedSave )
      {
        MacroPlan.ResetPeriodTasksAndFlushTrips();
      }
    }
    
    return proceedSave;
  *]
}