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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Quintiq file version 2.0
#parent: PanelButton/ButtonRecordNow
Response OnClick () id:Response_PanelButton_ButtonRecordNow_OnClick
{
  #keys: '[146874.1.152949734]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return GlobalStateKpiTracker.CheckActiveSnapshotGenerator( DataHolderSnapshotGenerator.Data() );
  *]
  QuillAction
  {
    Body:
    [*
      // Save the changed value and send the snapshot
      
      /* 
      1. ApplyChanges method is not available in Panel.
      2. Manually assign the changed value back to DataHolder
      */
      DataHolderSnapshotGenerator.Data().RetentionPeriod( DropDownStringListRetentionPolicy.Text() );
      DataHolderSnapshotGenerator.Data().Frequency( DurationSelectorFrequency.Duration() );
      DataHolderSnapshotGenerator.Data().LastRecordTimestamp( DateTimeSelectorStartTime.DateTime() );
      DataHolderSnapshotGenerator.Data().Description( EditorDescription.Text() );
      
      DataHolderSnapshotGenerator.Data().Commit();
      
      // Send the snapshot immediately.
      DataHolderSnapshotGenerator.Data().WrappedInstance().SendSnapshot();
      
      // Also set the latest timestamp to the start time.
      DateTimeSelectorStartTime.DateTime( DateTime::Now() );
      
      // Just to be sure, also set the time to the real instance.
      DataHolderSnapshotGenerator.Data().WrappedInstance().LastRecordTimestamp( DateTime::Now() );
    *]
    GroupServerCalls: false
  }
}