Quintiq file version 2.0
#parent: #root
Method New (
  internal[GUIComponent] parent,
  Bookmark selection
) as Bookmark id:Method_DialogCreateEditBookmark_New
{
  #keys: '[121072.0.291117934]'
  Body:
  [*
    // New bookmark
    
    data := ScenarioManager.Bookmark( relshadow, Name := EditorName.Text() );
    
    Dialog.Data( data );
    
    this.SetDefaultValues( selection );
    
    result := Dialog.DoModal( parent );
    
    bookmark := null( Bookmark );
    
    if( result > 0 )
    {
      bookmark := Bookmark::Create( EditorName.Text(),
                                    this.GetParentFolderName(),
                                    ScenarioManager,
                                    DataHolderSelectedUnit.Data(),
                                    DataHolderSelectedStockingPoint.Data(),
                                    DataHolderSelectedProduct.Data(),
                                    DataHolderSelectedSalesSegment.Data(),
                                    DataHolderPeriodObjects.Data(),
                                    false
                                   );
    }
    
    return bookmark;
  *]
}
