Quintiq file version 2.0
#parent: #root
Method UIEnableDisableKeepSafetyStock () id:Method_DialogCreateEditPISPSpecification_UIEnableDisableKeepSafetyStock
{
  #keys: '[136682.1.463854340]'
  Body:
  [*
    // Hide/show or disable keep safetystock
    if ( exists(  DataHolderDialogDatas.Data(), Elements, pisp, true , not pisp.IsLeaf() ) )
    {  
      CheckboxBatchIsSafetyStockKept.Visible( false );
      CheckboxIsSafetyStockKept.Visible( false );
    }
    //When has salesdemand disabled option to update keep safety stock
    else if ( exists( DataHolderDialogDatas.Data(), Elements, pisp, pisp.HasSalesDemand() ) )
    {
      CheckboxBatchIsSafetyStockKept.Visible( false );
      CheckboxIsSafetyStockKept.Enabled( false, Translations::MP_Designer_DialogCreateEditPISPSpecification_DisableKeepSafetyStock());  
    }
  *]
}
