Quintiq file version 2.0
#parent: #root
Method UpdateCheckboxState () id:Method_DialogCreateEditTransitionType_UpdateCheckboxState
{
  #keys: '[150660.1.727781821]'
  Body:
  [*
    // Update checkbox state based on the default quantity, default min quantity and default max quantity
    
    // By checking duration it will default to quantity if nothing is found
    quantitybased := RadioButtonGroupQuantityDuration.BoundValue() = GlobalParameters_MP::GetCampaignTransitionsTypeQuantity();
    durationbased := not quantitybased;
    
    // Show/hide durations
    PanelMinimumDuration.Visible( durationbased );
    PanelMaximumDuration.Visible( durationbased );
    
    // Show/hide quantity
    PanelMinimumQuantity.Visible( quantitybased );
    PanelMaximumQuantity.Visible( quantitybased );
    
    // Enable disable edit fields
    data := DataHolderDialogData.Data()
    this.EnableDisableMaxDuration( durationbased and data.HasInputMaxDuration() );
    this.EnableDisableMaxQuantity( quantitybased and data.HasInputMaxQuantity() );
  *]
}
