Quintiq file version 2.0
#parent: #root
Method OnCreated () id:Method_DialogCreateEditUOM_OnCreated
{
  #keys: '[139394.0.546854263]'
  Body:
  [*
    // On created
    // Update labels
    this.UpdateLabels();
    
    // Update factor
    data := DataHolderDialogData.Data();
    value := 1.0;
    if( not data.IsDefault() )
    {
      factor := select( MacroPlan.DefaultUnitOfMeasure(), AsSourceUnitOfMeasure, bcf, 
                               bcf.TargetUnitOfMeasure() = data.WrappedInstance() )
      value := guard( factor.Factor(), 1.0 );
      
      EditFieldFactor.Enabled( true, '' );
      LabelFactor.Visible( true );
    }
    
    EditFieldFactor.Text( [String]value );
  *]
}
