Quintiq file version 2.0
#parent: #root
Method SetImage (
  internal[Image] image,
  String newimg,
  Boolean isunit
) id:Method_DialogCreateEditGroup_SetImage
{
  #keys: '[107654.0.451587527]'
  Body:
  [*
    // Set image
    
    data := Dialog.Data();
    
    image.SetProperty( 'Image', newimg );
    
    // Need to update shadow object instead of label text because the text in label will not be commited / copied
    // to shadow object when data.Commit is called.
    if( isunit )
    {
      data.IconForUnits( newimg );
    }
    
    else
    {
      data.IconForStockingPoints( newimg );
    }
  *]
}
