yanweiyuan3
2023-10-27 d1d15b61dfcf7fd0f800b32359f082cf580ed556
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
Quintiq file version 2.0
#parent: #root
Method UIShowHideUOMWarning (
  UnitOfMeasure_MP selectionUOM
) id:Method_DialogCreateEditProduct_UIShowHideUOMWarning
{
  #keys: '[135040.0.287042047]'
  Body:
  [*
    // Enable & disable UOM warning
    // Show/hide components
    uom := guard( DataHolderDialogData.Data().UnitOfMeasure_MP(), null( UnitOfMeasure_MP ) );
    isshown := false;
    data := DataHolderDialogData.Data().WrappedInstance();
    
    //show warning for edit of product, not apply to creation of product
    if( not isnull( uom ) and not isnull( data ) )
    {
      isshown := uom <> selectionUOM;
    }
    
    ButtonImageUnitOfMeasurementWarning.Visible( isshown );
    
    
    if( isshown )
    {
      ButtonImageUnitOfMeasurementWarning.Tooltip(  ApplicationMacroPlanner.FormatLineBreakToHTMLLineBreak( data.GetUpdateUOMWarningMessage() ) );
    }
  *]
}